------- Comment #5 from hjl dot tools at gmail dot com  2008-07-07 19:37 -------
A small testcase:

[EMAIL PROTECTED] good]$ cat ../complex-7.c 
volatile _Complex float f1 = 1.1f + 2.2if;
volatile _Complex float f2 = 3.3f + 4.4if;
volatile _Complex float f3 = 5.5f + 6.6if;
volatile _Complex float f4 = 7.7f + 8.8if;
volatile _Complex float f5 = 9.9f + 10.1if;

extern void abort (void);
extern void exit (int);

__attribute__((noinline)) void
check_float (int a, _Complex float a1, _Complex float a2,
             _Complex float a3, _Complex float a4, _Complex float a5)
{
  if (a1 != f1 || a2 != f2 || a3 != f3 || a4 != f4 || a5 != f5)
    abort ();
}

int
main (void)
{
  check_float (0, f1, f2, f3, f4, f5);
  exit (0);
}
[EMAIL PROTECTED] good]$ 

diff -upr bad/complex-7.c.133r.expand good/complex-7.c.133r.expand
--- bad/complex-7.c.133r.expand 2008-07-07 12:33:14.000000000 -0700
+++ good/complex-7.c.133r.expand        2008-07-07 12:33:40.000000000 -0700
@@ -5,115 +5,115 @@
 ;; Generating RTL for tree basic block 2

 ;; D.1272 = REALPART_EXPR <a1>
-(insn 62 61 63 ../complex-7.c:14 (set (reg:DI 419)
+(insn 42 41 43 ../complex-7.c:14 (set (reg:DI 401)
         (reg/f:DI 335 virtual-stack-vars)) -1 (nil))

-(insn 63 62 64 ../complex-7.c:14 (set (reg/f:DI 420)
+(insn 43 42 44 ../complex-7.c:14 (set (reg/f:DI 402)
         (plus:DI (reg/f:DI 335 virtual-stack-vars)
-            (const_int 4 [0x4]))) -1 (nil))
+            (const_int 8 [0x8]))) -1 (nil))

-(insn 64 63 0 ../complex-7.c:14 (set (reg:SF 373 [ D.1272 ])
-        (mem/s/c:SF (reg/f:DI 420) [0 a1+0 S4 A32])) -1 (nil))
+(insn 44 43 0 ../complex-7.c:14 (set (reg:SF 373 [ D.1272 ])
+        (mem/s/c:SF (reg/f:DI 402) [0 a1+0 S4 A64])) -1 (nil))

The alignment of the first argument passed on stack is wrong.


-- 


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

Reply via email to