From 3a4b0b9968b920703c86e8701707e941ae0193a6 Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Sun, 25 Mar 2012 17:11:33 +0000 Subject: [PATCH] * gcc-interface/decl.c (SS_MARK_NAME): New define. (gnat_to_gnu_entity) : Prepend leaf attribute on entities whose name is SS_MARK_NAME. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185780 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/gcc-interface/decl.c | 18 ++++++++++++++++++ gcc/testsuite/ChangeLog | 6 +++++- gcc/testsuite/gnat.dg/concat2.adb | 18 ++++++++++++++++++ gcc/testsuite/gnat.dg/concat2.ads | 8 ++++++++ 5 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gnat.dg/concat2.adb create mode 100644 gcc/testsuite/gnat.dg/concat2.ads diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index efd3446..9a1f871 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,11 @@ 2012-03-25 Eric Botcazou + * gcc-interface/decl.c (SS_MARK_NAME): New define. + (gnat_to_gnu_entity) : Prepend leaf attribute on entities + whose name is SS_MARK_NAME. + +2012-03-25 Eric Botcazou + * gcc-interface/utils.c (add_parallel_type): Take a TYPE instead of a DECL and adjust. Move around. (has_parallel_type): New predicate. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 2139fbd..abd5185 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -81,6 +81,9 @@ #define FOREIGN_FORCE_REALIGN_STACK 0 #endif +/* The (internal) name of the System.Secondary_Stack.SS_Mark function. */ +#define SS_MARK_NAME "system__secondary_stack__ss_mark" + struct incomplete { struct incomplete *next; @@ -4405,6 +4408,21 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) get_identifier ("force_align_arg_pointer"), NULL_TREE, gnat_entity); + /* ??? Declare System.Secondary_Stack.SS_Mark as leaf, in order to + avoid creating abnormal edges in SJLJ mode, which can break the + dominance relationship if there is a dynamic stack allocation. + We cannot do this in System.Secondary_Stack directly since it's + a compiler unit and this would introduce bootstrap path issues. */ + if (IDENTIFIER_LENGTH (gnu_entity_name) == strlen (SS_MARK_NAME) + && IDENTIFIER_POINTER (gnu_entity_name)[0] == SS_MARK_NAME[0] + && IDENTIFIER_POINTER (gnu_entity_name)[1] == SS_MARK_NAME[1] + && IDENTIFIER_POINTER (gnu_entity_name)[2] == SS_MARK_NAME[2] + && gnu_entity_name == get_identifier (SS_MARK_NAME)) + prepend_one_attribute_to + (&attr_list, ATTR_MACHINE_ATTRIBUTE, + get_identifier ("leaf"), NULL_TREE, + gnat_entity); + /* The lists have been built in reverse. */ gnu_param_list = nreverse (gnu_param_list); if (has_stub) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9412052..b8c1c1b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,8 @@ -2012-03-21 Jason Merrill +2012-03-25 Eric Botcazou + + * gnat.dg/concat2.ad[sb]: New test. + +2012-03-24 Jason Merrill * g++.dg/cpp0x/auto3.C: Compile with -pedantic-errors. * g++.dg/cpp0x/trailing2.C: Likewise. diff --git a/gcc/testsuite/gnat.dg/concat2.adb b/gcc/testsuite/gnat.dg/concat2.adb new file mode 100644 index 0000000..221c4a3 --- /dev/null +++ b/gcc/testsuite/gnat.dg/concat2.adb @@ -0,0 +1,18 @@ +with Text_IO; use Text_IO; + +package body Concat2 is + + function Get_Param return String is + begin + return ""; + end; + + procedure Browse is + Mode : constant String := Get_Param; + Mode_Param : constant String := "MODE=" & Mode; + begin + Put_Line (Mode_Param); + end; + +end Concat2; + diff --git a/gcc/testsuite/gnat.dg/concat2.ads b/gcc/testsuite/gnat.dg/concat2.ads new file mode 100644 index 0000000..01e620b --- /dev/null +++ b/gcc/testsuite/gnat.dg/concat2.ads @@ -0,0 +1,8 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +package Concat2 is + + procedure Browse; + +end Concat2; -- 2.7.4