PR79066, non-PIC code generated for powerpc glibc with -fpic

PR target/79066
	* config/rs6000/rs6000.md (elf_high, elf_low): Disable when pic.
	* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't allow
	symbolic stack limit when pic.
testsuite/
	* gcc.target/powerpc/pr79066.c: New.

From-SVN: r244515
This commit is contained in:
Alan Modra 2017-01-17 13:24:11 +10:30 committed by Alan Modra
parent 86b957ca4f
commit e6750e5ce0
5 changed files with 29 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2017-01-17 Alan Modra <amodra@gmail.com>
PR target/79066
* config/rs6000/rs6000.md (elf_high, elf_low): Disable when pic.
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't allow
symbolic stack limit when pic.
2017-01-16 Martin Sebor <msebor@redhat.com>
PR tree-optimization/78608

View file

@ -27669,7 +27669,8 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, rtx copy_reg, int copy_off)
}
else if (GET_CODE (stack_limit_rtx) == SYMBOL_REF
&& TARGET_32BIT
&& DEFAULT_ABI == ABI_V4)
&& DEFAULT_ABI == ABI_V4
&& !flag_pic)
{
rtx toload = gen_rtx_CONST (VOIDmode,
gen_rtx_PLUS (Pmode,

View file

@ -10581,14 +10581,14 @@
(define_insn "elf_high"
[(set (match_operand:SI 0 "gpc_reg_operand" "=b*r")
(high:SI (match_operand 1 "" "")))]
"TARGET_ELF && ! TARGET_64BIT"
"TARGET_ELF && !TARGET_64BIT && !flag_pic"
"lis %0,%1@ha")
(define_insn "elf_low"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
(match_operand 2 "" "")))]
"TARGET_ELF && ! TARGET_64BIT"
"TARGET_ELF && !TARGET_64BIT && !flag_pic"
"la %0,%2@l(%1)")
;; Call and call_value insns

View file

@ -1,3 +1,7 @@
2017-01-17 Alan Modra <amodra@gmail.com>
* gcc.target/powerpc/pr79066.c: New.
2017-01-16 Jeff Law <law@redhat.com>
PR tree-optimization/33562

View file

@ -0,0 +1,14 @@
/* { dg-do compile { target { fpic && ilp32 } } } */
/* { dg-options "-O2 -fpic" } */
/* { dg-final { scan-assembler-not "lis.*@ha" } } */
union U { double x; int i[2]; };
double
foo (double x)
{
union U v;
v.i[0] = 0x7ff00000;
v.i[1] = 0;
return x / v.x;
}