Bug 60693 - [4.8 Regression] ICE on funny memcpy
Summary: [4.8 Regression] ICE on funny memcpy
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.2
: P1 normal
Target Milestone: 4.8.3
Assignee: Jakub Jelinek
URL:
Keywords:
: 61988 63490 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-28 07:56 UTC by Andy Lutomirski
Modified: 2014-10-08 18:58 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.7.3, 4.9.0
Known to fail: 4.8.3
Last reconfirmed: 2014-03-28 00:00:00


Attachments
gcc49-pr60693.patch (494 bytes, patch)
2014-03-28 11:10 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Lutomirski 2014-03-28 07:56:19 UTC
This little program:

int main()
{
  char buf[4096];
  memcpy(buf, (void *)0xffffffffff600000, 4096);

  return 0;
}

does this:

$ gcc ice.c
ice.c: In function ‘main’:
ice.c:4:3: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
   memcpy(buf, (void *)0xffffffffff600000, 4096);
   ^
ice.c:4:9: internal compiler error: in ix86_copy_addr_to_reg, at config/i386/i386.c:21886
   memcpy(buf, (void *)0xffffffffff600000, 4096);
         ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccJqACry.out file, please attach this to your bugreport.


This is gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7).
Comment 1 Markus Trippelsdorf 2014-03-28 08:08:43 UTC
Started with r203486.
Comment 2 Markus Trippelsdorf 2014-03-28 08:10:59 UTC
And with r204338 on the 4.8 branch.
Comment 3 Jakub Jelinek 2014-03-28 11:10:32 UTC
Created attachment 32472 [details]
gcc49-pr60693.patch

Untested fix.
Comment 4 Jakub Jelinek 2014-03-28 19:31:49 UTC
Author: jakub
Date: Fri Mar 28 19:31:17 2014
New Revision: 208915

URL: http://gcc.gnu.org/viewcvs?rev=208915&root=gcc&view=rev
Log:
	PR target/60693
	* config/i386/i386.c (ix86_copy_addr_to_reg): Call copy_addr_to_reg
	also if addr has VOIDmode.

	* gcc.target/i386/pr60693.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr60693.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 Jakub Jelinek 2014-03-28 19:33:08 UTC
Fixed on the trunk so far.
Comment 6 Jakub Jelinek 2014-04-10 07:57:41 UTC
Author: jakub
Date: Thu Apr 10 07:57:09 2014
New Revision: 209268

URL: http://gcc.gnu.org/viewcvs?rev=209268&root=gcc&view=rev
Log:
	Backport from mainline
	2014-03-28  Jakub Jelinek  <jakub@redhat.com>

	PR target/60693
	* config/i386/i386.c (ix86_copy_addr_to_reg): Call copy_addr_to_reg
	also if addr has VOIDmode.

	* gcc.target/i386/pr60693.c: New test.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.target/i386/pr60693.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/config/i386/i386.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
Comment 7 Jakub Jelinek 2014-04-10 08:06:08 UTC
Fixed.
Comment 8 Jakub Jelinek 2014-08-01 18:04:14 UTC
*** Bug 61988 has been marked as a duplicate of this bug. ***
Comment 9 Jakub Jelinek 2014-10-08 18:58:20 UTC
*** Bug 63490 has been marked as a duplicate of this bug. ***