summaryrefslogtreecommitdiffstats
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index d877c0f8469..ff8e83afdc1 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1762,6 +1762,10 @@ warn_logical_operator (location_t location, enum tree_code code,
bool
strict_aliasing_warning (tree otype, tree type, tree expr)
{
+ /* Strip pointer conversion chains and get to the correct original type. */
+ STRIP_NOPS (expr);
+ otype = TREE_TYPE (expr);
+
if (!(flag_strict_aliasing
&& POINTER_TYPE_P (type)
&& POINTER_TYPE_P (otype)
OpenPOWER on IntegriCloud