+2019-04-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ Backport from mainline
+ 2019-02-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * rtlanal.c (get_initial_register_offset): Fall back to the estimate
+ as long as the epilogue isn't completed.
+
2019-04-03 Richard Biener <rguenther@suse.de>
PR lto/89896
if (to == from)
return 0;
- /* It is not safe to call INITIAL_ELIMINATION_OFFSET
- before the reload pass. We need to give at least
- an estimation for the resulting frame size. */
- if (! reload_completed)
+ /* It is not safe to call INITIAL_ELIMINATION_OFFSET before the epilogue
+ is completed, but we need to give at least an estimate for the stack
+ pointer based on the frame size. */
+ if (!epilogue_completed)
{
offset1 = crtl->outgoing_args_size + get_frame_size ();
#if !STACK_GROWS_DOWNWARD
+2019-04-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt73.adb: New test.
+
2019-04-02 Xiong Hu Luo <luoxhu@linux.ibm.com>
Backport from trunk r250477.
--- /dev/null
+-- { dg-do run }
+-- { dg-options "-O" }
+
+procedure Opt73 is
+
+ type Terminal_Set_Indexed_By_Non_Terminal is
+ array (Natural range <>, Natural range <>) of Boolean with Pack;
+
+ type Terminal_Set_Per_Non_Terminal
+ (Last_Terminal : Natural;
+ Last_Non_Terminal : Natural) is
+ record
+ Map : Terminal_Set_Indexed_By_Non_Terminal
+ (1 .. Last_Non_Terminal, 0 .. Last_Terminal);
+ end record;
+
+ Follow : Terminal_Set_Per_Non_Terminal (5, 4);
+ Expect : Terminal_Set_Per_Non_Terminal :=
+ (5, 4, (1 => (2 => True, others => False),
+ others => (others => False)));
+
+ procedure Get_Follow (Value : out Terminal_Set_Per_Non_Terminal) is
+ begin
+ Value.Map := (others => (others => False));
+ Value.Map (1, 2) := True;
+ Value.Map (2, 0) := Value.Map (2, 0) or Value.Map (1, 0);
+ end;
+
+begin
+ Get_Follow (Follow);
+ if Follow /= Expect then
+ raise Program_Error;
+ end if;
+end;