public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/59990] New: [4.7/4.8/4.9 regression] incorrect memcpy optimization
@ 2014-01-29 20:31 ebotcazou at gcc dot gnu.org
  2014-01-29 21:06 ` [Bug middle-end/59990] " joseph at codesourcery dot com
                   ` (27 more replies)
  0 siblings, 28 replies; 29+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2014-01-29 20:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59990
           Summary: [4.7/4.8/4.9 regression] incorrect memcpy optimization
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ebotcazou at gcc dot gnu.org
            Target: i?86-*-*

This is a regression introduced in the 4.7.x series of compilers, visible on
x86 but probably reproducible on other platforms.  If you compile:

extern void abort (void);

unsigned char value[4] = { 66, 9, 160, 255 };

int main (void)
{
  volatile float f;
  unsigned char a[4];

  __builtin_memcpy ((void *)&f, value, 4);
  __builtin_memcpy (a, (void *)&f, 4);
  if (a[2] != 160)
    abort ();

  return 0;
}

with optimization enabled, it aborts at run time because FP instructions are
incorrectly used to implement the memcpy operations.


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-06-10 13:51 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-29 20:31 [Bug middle-end/59990] New: [4.7/4.8/4.9 regression] incorrect memcpy optimization ebotcazou at gcc dot gnu.org
2014-01-29 21:06 ` [Bug middle-end/59990] " joseph at codesourcery dot com
2014-01-29 21:17 ` [Bug target/59990] " pinskia at gcc dot gnu.org
2014-01-29 22:28 ` [Bug middle-end/59990] " ebotcazou at gcc dot gnu.org
2014-01-30  3:45 ` [Bug target/59990] " hjl.tools at gmail dot com
2014-01-30  8:10 ` [Bug middle-end/59990] " ebotcazou at gcc dot gnu.org
2014-01-30  8:15 ` jakub at gcc dot gnu.org
2014-01-30  8:31 ` ebotcazou at gcc dot gnu.org
2014-01-30 12:08 ` rguenth at gcc dot gnu.org
2014-01-30 12:49 ` rguenth at gcc dot gnu.org
2014-01-30 12:53 ` rguenth at gcc dot gnu.org
2014-01-30 13:15 ` jakub at gcc dot gnu.org
2014-01-30 16:43 ` joseph at codesourcery dot com
2014-01-30 17:38 ` jakub at gcc dot gnu.org
2014-01-31 11:39 ` rguenth at gcc dot gnu.org
2014-01-31 11:55 ` rguenth at gcc dot gnu.org
2014-01-31 11:55 ` [Bug middle-end/59990] [4.7/4.8 " rguenth at gcc dot gnu.org
2014-01-31 11:55 ` rguenth at gcc dot gnu.org
2014-02-10 15:25 ` rguenth at gcc dot gnu.org
2014-02-10 15:29 ` rguenth at gcc dot gnu.org
2014-06-12 13:46 ` rguenth at gcc dot gnu.org
2014-12-19 13:29 ` [Bug middle-end/59990] [4.8 " jakub at gcc dot gnu.org
2015-02-16 13:19 ` anders.blomdell at control dot lth.se
2015-02-16 13:20 ` anders.blomdell at control dot lth.se
2015-02-16 13:23 ` anders.blomdell at control dot lth.se
2015-02-16 13:25 ` anders.blomdell at control dot lth.se
2015-02-16 13:26 ` anders.blomdell at control dot lth.se
2015-06-10 12:53 ` rguenth at gcc dot gnu.org
2015-06-10 13:51 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).