[Bug c++/21619] New: [4.0/4.1 regression] __builtin_constant_p(&"Hello"[0])?1:-1 not compile-time constant

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue May 17 11:42:00 GMT 2005


The testcase

int f[__builtin_constant_p(&"Hello"[0])?1:-1];

did work on gcc 3.4, but doesn't any longer on 4.0 and 4.1.

The parser gets an integer constant node from fold_builtin, but still
thinks it is not a compile time constant for the array bound.

-- 
           Summary: [4.0/4.1 regression]
                    __builtin_constant_p(&"Hello"[0])?1:-1 not compile-time
                    constant
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: rejects-valid, missed-optimization
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 BugsThisDependsOn: 21595


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21619



More information about the Gcc-bugs mailing list