Hmmm. This is not the right fix: the tests Richard fixed, were failing because
of lack of constant propagation and DCE at compile-time, which then didn't
eliminate the call to link_error. The AArch64 test is failing because this from
aarch64/constraints.md:

(define_constraint "S"
   "A constraint that matches an absolute symbolic address."
   (and (match_code "const,symbol_ref,label_ref")
        (match_test "aarch64_symbolic_address_p (op)")))

previously was seeing (and being satisfied by):

(const:DI (plus:DI (symbol_ref:DI ("test") [flags 0x3] <function_decl
0x7fb7c60300 test>)
         (const_int 4 [0x4])))

but following Richard's patch the constraint is evaluated only on:

(reg/f:DI 73 [ D.2670 ])


--Alan

Alan Lawrence wrote:
Following Richard Biener's patch at https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01064.html (r221532), gcc.target/aarch64/c-output-template-3.c fails with:

c-output-template-3.c: In function 'test':
c-output-template-3.c:7:5: error: impossible constraint in 'asm'
      __asm__ ("@ %c0" : : "S" (&test + 4));

This patch fixes the test by changing options to -O in a similar manner to Richard's fixes to gcc.dg/pr15347.c and c-c++-common/pr19807-1.c.

Ok for trunk?

Cheers, Alan

gcc/testsuite/ChangeLog:

        gcc.target/aarch64/c-output-template.c: Add -O, remove
        -Wno-pointer-arith.


Reply via email to