aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr104337.c15
-rw-r--r--gcc/tree-nrv.cc13
2 files changed, 15 insertions, 13 deletions
diff --git a/gcc/testsuite/gcc.dg/debug/pr104337.c b/gcc/testsuite/gcc.dg/debug/pr104337.c
new file mode 100644
index 0000000..d15680f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr104337.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+struct a {
+ unsigned b : 7;
+};
+inline __attribute__((optimize(3))) __attribute__((always_inline)) struct a
+c() {
+ struct a d;
+ return d;
+}
+void e() {
+ for (;;)
+ c();
+}
+int main() {}
diff --git a/gcc/tree-nrv.cc b/gcc/tree-nrv.cc
index a67736d..b96d5b8 100644
--- a/gcc/tree-nrv.cc
+++ b/gcc/tree-nrv.cc
@@ -236,19 +236,6 @@ pass_nrv::execute (function *fun)
fprintf (dump_file, "\n");
}
- /* At this point we know that all the return statements return the
- same local which has suitable attributes for NRV. Copy debugging
- information from FOUND to RESULT if it will be useful. But don't set
- DECL_ABSTRACT_ORIGIN to point at another function. */
- if (!DECL_IGNORED_P (found)
- && !(DECL_ABSTRACT_ORIGIN (found)
- && DECL_CONTEXT (DECL_ABSTRACT_ORIGIN (found)) != current_function_decl))
- {
- DECL_NAME (result) = DECL_NAME (found);
- DECL_SOURCE_LOCATION (result) = DECL_SOURCE_LOCATION (found);
- DECL_ABSTRACT_ORIGIN (result) = DECL_ABSTRACT_ORIGIN (found);
- }
-
TREE_ADDRESSABLE (result) |= TREE_ADDRESSABLE (found);
/* Now walk through the function changing all references to VAR to be