Commit 1c49a3ed by Eric Botcazou

re PR bootstrap/80897 (gnat bootstrap broken on SPARC64/Linux)

	PR target/80897
	* config/sparc/sparc.c (sparc_emit_set_symbolic_const64): Deal with too
	large offsets.

From-SVN: r251847
parent fac51974
2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
PR target/80897
* config/sparc/sparc.c (sparc_emit_set_symbolic_const64): Deal with too
large offsets.
2017-09-07 Carl Love <cel@us.ibm.com> 2017-09-07 Carl Love <cel@us.ibm.com>
* config/rs6000/vsx.md (define_insn "*stxvl"): Add missing argument to the sldi instruction. * config/rs6000/vsx.md (define_insn "*stxvl"): Add missing argument to
the sldi instruction.
2017-09-07 David Edelsohn <dje.gcc@gmail.com> 2017-09-07 David Edelsohn <dje.gcc@gmail.com>
......
...@@ -2159,9 +2159,25 @@ sparc_emit_set_const32 (rtx op0, rtx op1) ...@@ -2159,9 +2159,25 @@ sparc_emit_set_const32 (rtx op0, rtx op1)
void void
sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp)
{ {
rtx temp1, temp2, temp3, temp4, temp5; rtx cst, temp1, temp2, temp3, temp4, temp5;
rtx ti_temp = 0; rtx ti_temp = 0;
/* Deal with too large offsets. */
if (GET_CODE (op1) == CONST
&& GET_CODE (XEXP (op1, 0)) == PLUS
&& CONST_INT_P (cst = XEXP (XEXP (op1, 0), 1))
&& trunc_int_for_mode (INTVAL (cst), SImode) != INTVAL (cst))
{
gcc_assert (!temp);
temp1 = gen_reg_rtx (DImode);
temp2 = gen_reg_rtx (DImode);
sparc_emit_set_const64 (temp2, cst);
sparc_emit_set_symbolic_const64 (temp1, XEXP (XEXP (op1, 0), 0),
NULL_RTX);
emit_insn (gen_rtx_SET (op0, gen_rtx_PLUS (DImode, temp1, temp2)));
return;
}
if (temp && GET_MODE (temp) == TImode) if (temp && GET_MODE (temp) == TImode)
{ {
ti_temp = temp; ti_temp = temp;
......
2017-09-07 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt67.adb: New test.
* gnat.dg/opt67_pkg.ad[sb]: New helper.
2017-09-07 Jakub Jelinek <jakub@redhat.com> 2017-09-07 Jakub Jelinek <jakub@redhat.com>
PR target/81979 PR target/81979
......
-- { dg-do run }
-- { dg-options "-O" }
with Opt67_Pkg; use Opt67_Pkg;
procedure Opt67 is
function Predef_Stream_Attr_Spec
(Loc : Source_Ptr;
Tag_Typ : Entity_Id;
Name : TSS_Name_Type) return Node_Id is
begin
return Predef (Loc, Make_TSS_Name (Tag_Typ, Name), Tag_Typ);
end;
Stream_Op_TSS_Names :
constant array (Integer range <>) of TSS_Name_Type :=
(TSS_Stream_Read,
TSS_Stream_Write,
TSS_Stream_Input,
TSS_Stream_Output);
Tag_Typ : constant Entity_Id := Entity_Id(Init);
Res : constant Natural := Init;
Loc : constant Source_Ptr := Source_Ptr(Init);
begin
for Op in Stream_Op_TSS_Names'Range loop
if Stream_Operation_OK (Tag_Typ, Stream_Op_TSS_Names (Op)) then
Append_To (Res,
Predef_Stream_Attr_Spec (Loc, Tag_Typ,
Stream_Op_TSS_Names (Op)));
end if;
end loop;
end;
package body Opt67_Pkg is
function Make_TSS_Name (Typ : Entity_Id; Nam : TNT) return Name_Id is
begin
return 0;
end;
function Stream_Operation_OK (N : Entity_Id; Name : TNT) return Boolean is
begin
return True;
end;
procedure Append_To (N1 : Natural; N2 : Node_Id) is
begin
null;
end;
function Predef (Loc : Source_Ptr; Name : Name_Id; E : Entity_Id)
return Node_Id is
begin
return 0;
end;
function Init return Natural is
begin
return 0;
end;
end Opt67_Pkg;
package Opt67_Pkg is
type Source_Ptr is new Natural;
type Entity_Id is new Natural;
type Node_Id is new Natural;
type Name_Id is new Natural;
type TSS_Name_Type is new String (1 .. 2);
subtype TNT is TSS_Name_Type;
TSS_Stream_Input : constant TNT := "SI";
TSS_Stream_Output : constant TNT := "SO";
TSS_Stream_Read : constant TNT := "SR";
TSS_Stream_Write : constant TNT := "SW";
TSS_To_Any : constant TNT := "TA";
function Make_TSS_Name (Typ : Entity_Id; Nam : TSS_Name_Type) return Name_Id;
function Stream_Operation_OK (N : Entity_Id; Name : TNT) return Boolean;
procedure Append_To (N1 : Natural; N2 : Node_Id);
function Predef (Loc : Source_Ptr; Name : Name_Id; E : Entity_Id)
return Node_Id;
function Init return Natural;
end Opt67_Pkg;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment