diff mbox

[RS6000] powerpc64 -mcmodel=medium large symbol offsets

Message ID 20130911111249.GE2643@bubble.grove.modra.org
State New
Headers show

Commit Message

Alan Modra Sept. 11, 2013, 11:12 a.m. UTC
On Mon, Sep 09, 2013 at 06:37:03PM +0930, Alan Modra wrote:
> gcc/
> 	* config/rs6000/predicates.md (add_cint_operand): New.
> 	(reg_or_add_cint_operand): Use add_cint_operand.
> 	* config/rs6000/rs6000.md (largetoc_high_plus): Restrict offset
> 	using add_cint_operand.
> 	(largetoc_high_plus_aix, small_toc_ref): Likewise.
> gcc/testsuite/
> 	* gcc.target/powerpc/medium_offset.c: New.

I missed seeing one testcase regression caused by this patch.  :-(
gcc.c-torture/compile/pr41634.c at -O3 gets an "insn does not satisfy
its constraints".  Fixed with the following.  OK to apply?

	* config/rs6000/rs6000.c (toc_relative_expr_p): Use add_cint_operand.

Comments

David Edelsohn Sept. 11, 2013, 8:56 p.m. UTC | #1
On Wed, Sep 11, 2013 at 7:12 AM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, Sep 09, 2013 at 06:37:03PM +0930, Alan Modra wrote:
>> gcc/
>>       * config/rs6000/predicates.md (add_cint_operand): New.
>>       (reg_or_add_cint_operand): Use add_cint_operand.
>>       * config/rs6000/rs6000.md (largetoc_high_plus): Restrict offset
>>       using add_cint_operand.
>>       (largetoc_high_plus_aix, small_toc_ref): Likewise.
>> gcc/testsuite/
>>       * gcc.target/powerpc/medium_offset.c: New.
>
> I missed seeing one testcase regression caused by this patch.  :-(
> gcc.c-torture/compile/pr41634.c at -O3 gets an "insn does not satisfy
> its constraints".  Fixed with the following.  OK to apply?
>
>         * config/rs6000/rs6000.c (toc_relative_expr_p): Use add_cint_operand.

Okay.

Thanks, David
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 202428)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -5926,7 +5906,7 @@  toc_relative_expr_p (const_rtx op, bool strict)
 
   tocrel_base = op;
   tocrel_offset = const0_rtx;
-  if (GET_CODE (op) == PLUS && CONST_INT_P (XEXP (op, 1)))
+  if (GET_CODE (op) == PLUS && add_cint_operand (XEXP (op, 1), GET_MODE (op)))
     {
       tocrel_base = XEXP (op, 0);
       tocrel_offset = XEXP (op, 1);