summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr43058.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-18 20:15:05 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-18 20:15:05 +0000
commit1197d3d74cc96446be5f8f1d25a45b220fc311ff (patch)
tree0bfa407d0115ac5a0e33cddaa34238222042382f /gcc/testsuite/gcc.dg/pr43058.c
parentc596d83002a937c3943de34c6f47da047337f865 (diff)
downloadgcc-1197d3d74cc96446be5f8f1d25a45b220fc311ff.tar.gz
PR debug/43058
* var-tracking.c (non_suitable_const): New function. (add_uses): For DEBUG_INSNs with constants, don't record any value, instead just the constant value itself. (compute_bb_dataflow) <case MO_VAL_LOC>: If PAT_VAR_LOCATION_LOC is not VAR_LOC_UNKNOWN_P, set var to the constant. (emit_notes_in_bb): Likewise. (emit_note_insn_var_location): For onepart variables if cur_loc is a VOIDmode constant, use DECL_MODE. * gcc.dg/pr43058.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157547 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr43058.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr43058.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr43058.c b/gcc/testsuite/gcc.dg/pr43058.c
new file mode 100644
index 00000000000..50d8a63bb8f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43058.c
@@ -0,0 +1,20 @@
+/* PR debug/43058 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+
+extern void *f1 (void *, void *, void *);
+extern void *f2 (const char *, int, int, int, void *(*) ());
+extern void *f3 (const char *);
+extern void *f4 (void *s);
+extern void *f5 (void *);
+
+void test (void)
+{
+#define X1 f1 (f2 ("a", 1, 0, 0, f5), \
+ f4 (({ const char *a = "b"; f3 (a); })), \
+ ({ const char *a = "c"; f3 (a); }));
+#define X2 X1 X1 X1 X1 X1 X1 X1 X1 X1 X1
+#define X3 X2 X2 X2 X2 X2 X2 X2 X2 X2 X2
+#define X4 X3 X3 X3 X3 X3 X3 X3 X3 X3 X3
+ X4 X4
+}