https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64328

            Bug ID: 64328
           Summary: addr_equal-1.c fails execution.
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: belagod at gcc dot gnu.org

FAIL: gcc.dg/addr_equal-1.c execution test

$ aarch64-none-elf-gcc 
/work/dev/arm/src/gcc/gcc/testsuite/gcc.dg/addr_equal-1.c -O2 -lm -mcmodel=tiny
-fPIC -o foo.exe

fails on AArch64. This test was introduced by this patch:

https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00613.html

The specific test that's failing is

  if (!__builtin_constant_p (&def_var0 == &def_var1))
    abort();

where def_var0 and def_var1 are globals declared in the same translation unit.
When compiled with fPIC, how much can we know about their addresses at
compile-time for the above test to pass? Is this test valid?

Reply via email to