aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2015-02-04 14:24:00 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2015-02-04 14:24:00 +0000
commit871dae346542544552ae7c74cd63f7036bd2ad74 (patch)
treead0568979dce71bbcf4e2054007589eecb9c4ef2
parentaf9f5d95df023eab3779878815bc2ad09870f36e (diff)
downloadgcc-871dae346542544552ae7c74cd63f7036bd2ad74.zip
gcc-871dae346542544552ae7c74cd63f7036bd2ad74.tar.gz
gcc-871dae346542544552ae7c74cd63f7036bd2ad74.tar.bz2
Fix signedness of compares expanding debug exprs.
for gcc/ChangeLog PR debug/64817 * cfgexpand.c (expand_debug_expr): Compute unsignedp from operands for tcc_comparison exprs. Fix typos. for gcc/testsuite/ChangeLog PR debug/64817 * gcc.dg/pr64817-3.c: New. From-SVN: r220406
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cfgexpand.c9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr64817-3.c13
4 files changed, 28 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 977e208..47133e9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,10 @@
2015-02-04 Alexandre Oliva <aoliva@redhat.com>
PR debug/64817
+ * cfgexpand.c (expand_debug_expr): Compute unsignedp from
+ operands for tcc_comparison exprs. Fix typos.
+
+ PR debug/64817
* simplify-rtx.c (simplify_binary_operation_1): Simplify one
of two XORs that have an intervening AND or IOR.
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 12021de..7dfe1f6 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3911,7 +3911,6 @@ expand_debug_expr (tree exp)
binary:
case tcc_binary:
- case tcc_comparison:
op1 = expand_debug_expr (TREE_OPERAND (exp, 1));
if (!op1)
return NULL_RTX;
@@ -3925,6 +3924,10 @@ expand_debug_expr (tree exp)
return NULL_RTX;
break;
+ case tcc_comparison:
+ unsignedp = TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)));
+ goto binary;
+
case tcc_type:
case tcc_statement:
gcc_unreachable ();
@@ -4006,7 +4009,7 @@ expand_debug_expr (tree exp)
op0 = copy_rtx (op0);
if (GET_MODE (op0) == BLKmode
- /* If op0 is not BLKmode, but BLKmode is, adjust_mode
+ /* If op0 is not BLKmode, but mode is, adjust_mode
below would ICE. While it is likely a FE bug,
try to be robust here. See PR43166. */
|| mode == BLKmode
@@ -5285,7 +5288,7 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
if (have_debug_uses)
{
- /* OP is a TERed SSA name, with DEF it's defining
+ /* OP is a TERed SSA name, with DEF its defining
statement, and where OP is used in further debug
instructions. Generate a debug temporary, and
replace all uses of OP in debug insns with that
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0f99a1f..c1b4305 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-04 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/64817
+ * gcc.dg/pr64817-3.c: New.
+
2015-02-04 Jakub Jelinek <jakub@redhat.com>
Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
diff --git a/gcc/testsuite/gcc.dg/pr64817-3.c b/gcc/testsuite/gcc.dg/pr64817-3.c
new file mode 100644
index 0000000..3fe0117
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr64817-3.c
@@ -0,0 +1,13 @@
+/* PR debug/64817 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -g" } */
+
+int a;
+
+void
+foo (void)
+{
+ int e;
+ a = ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((a & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) & 231) ^ 14) ^ 1;
+ e = (a > 0);
+}