This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/53424] dynamic array expressions get wrong sizeof() if pointers to const are involved and the pointers are changed (const is misapplied to the whole expression)


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-05-20
     Ever Confirmed|0                           |1
           Severity|major                       |normal

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-20 08:17:57 UTC ---
There is no SAVE_EXPR wrapped around the *x for some reason which is causing
the issue.

Add the following to make a runtime test:
void usebuf(char *) __attribute__((noinline,noclone));
void usebuf(char *a)
{
  asm ("");
}


int main(void)
{
  if (works () != broken ())
    __builtin_abort ();
  nocrash ();
  crashes ();
  if (negativesizeof() != works ())
    __builtin_abort ();
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]