https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64014

            Bug ID: 64014
           Summary: [5 regression] Failure of
                    gcc.dg/torture/stackalign/regparm-1.c
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org

On x86_64-apple-darwin14, gcc.dg/torture/stackalign/regparm-1.c is failing (at
-m32). This regression was introduced somewhere between r217694 (passes) and
r217836 (fails).

Reduced reproducer is:

int __attribute__ ((__regparm__(3)))
test_realigned (int j, int k, int l)
{
  int y __attribute__((aligned(64)));
  return ((__PTRDIFF_TYPE__) y) & (__alignof__(y) - 1);
}

which fails with "gcc -m32" with an ICE. The backtrace is:

    frame #9: 0x0000000100d2df56 cc1`fancy_abort(file=<unavailable>,
line=<unavailable>, function=<unavailable>) + 38 at diagnostic.c:1249
    frame #10: 0x0000000100ce2047 cc1`ix86_expand_prologue() + 5751 at
i386.c:11347
    frame #11: 0x00000001002374fb cc1`gen_prologue() + 11 at i386.md:12095
    frame #12: 0x000000010064d82c cc1`thread_prologue_and_epilogue_insns() +
204 at function.c:5906
    frame #13: 0x000000010064e207 cc1`execute [inlined]
rest_of_handle_thread_prologue_and_epilogue + 22 at function.c:6476
    frame #14: 0x000000010064e1f1 cc1`execute(this=<unavailable>,
(null)=<unavailable>) + 1
    frame #15: 0x00000001008b1c6b cc1`execute_one_pass(pass=0x0000000141e13910)
+ 379 at passes.c:2311
    frame #16: 0x00000001008b210e
cc1`execute_pass_list_1(pass=0x0000000141e13910) + 30 at passes.c:2363
    frame #17: 0x00000001008b2120
cc1`execute_pass_list_1(pass=0x0000000141e13670) + 48 at passes.c:2364
    frame #18: 0x00000001008b2120
cc1`execute_pass_list_1(pass=0x0000000141e12590) + 48 at passes.c:2364
    frame #19: 0x00000001008b2169 cc1`execute_pass_list(fn=0x0000000142d1f5e8,
pass=0x0000000141e0f3b0) + 25 at passes.c:2374
    frame #20: 0x00000001004cbde5
cc1`cgraph_node::expand(this=0x0000000142c12498) + 261 at cgraphunit.c:1773
    frame #21: 0x00000001004ccd0f cc1`output_in_order(no_reorder=<unavailable>)
+ 559 at cgraphunit.c:2011
    frame #22: 0x00000001004cd27a
cc1`symbol_table::compile(this=0x0000000142c05000) + 922 at cgraphunit.c:2257
    frame #23: 0x00000001004cf3ce
cc1`symbol_table::finalize_compilation_unit(this=0x0000000142c05000) + 110 at
cgraphunit.c:2340
    frame #24: 0x0000000100020ec9 cc1`c_write_global_declarations() + 601 at
c-decl.c:10777
    frame #25: 0x000000010098d20f cc1`compile_file + 143 at toplev.c:584

Any optimization (-O1, -O2, -O3 or -Os) makes the testcase pass.

Reply via email to