cfgexpand.c (expand_gimple_stmt_1): If the statement doesn't have location...
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 12 Jul 2019 09:35:21 +0000 (09:35 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 12 Jul 2019 09:35:21 +0000 (09:35 +0000)
* cfgexpand.c (expand_gimple_stmt_1) <GIMPLE_RETURN>: If the statement
doesn't have location, set the current location to the function's end

From-SVN: r273434

gcc/ChangeLog
gcc/cfgexpand.c

index 66e715f42e9b415520a56833276327e4e6e62ec0..e75e1ec8da6172234cef7f89d9f787636b662a0c 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-12  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * cfgexpand.c (expand_gimple_stmt_1) <GIMPLE_RETURN>: If the statement
+       doesn't have location, set the current location to the function's end.
+
 2019-07-12  Richard Sandiford  <richard.sandiford@arm.com>
 
        * config/aarch64/aarch64.md (*compare_condjump<mode>)
index d0c1d31a2cce86accfb79e3debdadb63d4e1f2ba..33af991573fa586427e4fa984d1aa747fc7eb211 100644 (file)
@@ -3714,6 +3714,12 @@ expand_gimple_stmt_1 (gimple *stmt)
       {
        op0 = gimple_return_retval (as_a <greturn *> (stmt));
 
+       /* If a return doesn't have a location, it very likely represents
+          multiple user returns so we cannot let it inherit the location
+          of the last statement of the previous basic block in RTL.  */
+       if (!gimple_has_location (stmt))
+         set_curr_insn_location (cfun->function_end_locus);
+
        if (op0 && op0 != error_mark_node)
          {
            tree result = DECL_RESULT (current_function_decl);