This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/48496] [4.7 Regression] 'asm' operand requires impossible reload in libffi/src/ia64/ffi.c
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 14 Jan 2012 17:45:28 +0000
- Subject: [Bug rtl-optimization/48496] [4.7 Regression] 'asm' operand requires impossible reload in libffi/src/ia64/ffi.c
- Auto-submitted: auto-generated
- References: <bug-48496-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48496
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-14 17:45:28 UTC ---
Doesn't this code violate strict aliasing though? And, it passes with
-fno-strict-aliasing. Therefore, I think it would be better to fix up the
strict aliasing violation in libffi. completely untested patch:
--- libffi/src/ia64/ffi.c 2010-08-11 21:08:14.000000000 +0200
+++ libffi/src/ia64/ffi.c 2012-01-14 18:43:35.652923850 +0100
@@ -324,13 +324,17 @@ ffi_call(ffi_cif *cif, void (*fn)(void),
case FFI_TYPE_FLOAT:
if (gpcount < 8 && fpcount < 8)
stf_spill (&stack->fp_regs[fpcount++], *(float *)avalue[i]);
- stack->gp_regs[gpcount++] = *(UINT32 *)avalue[i];
+ {
+ UINT32 tmp;
+ memcpy (&tmp, avalue[i], sizeof (UINT32));
+ stack->gp_regs[gpcount++] = tmp;
+ }
break;
case FFI_TYPE_DOUBLE:
if (gpcount < 8 && fpcount < 8)
stf_spill (&stack->fp_regs[fpcount++], *(double *)avalue[i]);
- stack->gp_regs[gpcount++] = *(UINT64 *)avalue[i];
+ memcpy (&stack->gp_regs[gpcount++], avalue[i], sizeof (UINT64));
break;
case FFI_TYPE_LONGDOUBLE:
With that IMHO this should be just a P2, not P1.