summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-02-21 19:51:51 +0100
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-04-28 23:35:41 +0200
commit64bd0e673c8b6ace59ae6b9c7167727824d5c75d (patch)
tree4cd1bc8b1fa2aa1c2e1c10a7259be0f829109c34 /gcc
parent9a8135285f62ad9d6a0f6f8b24747bcd7850d13f (diff)
Fixes warnings
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ipa-str-reorg-dead-field-eliminate.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/gcc/ipa-str-reorg-dead-field-eliminate.c b/gcc/ipa-str-reorg-dead-field-eliminate.c
index 9dd0f483f9d..8e3cdadf809 100644
--- a/gcc/ipa-str-reorg-dead-field-eliminate.c
+++ b/gcc/ipa-str-reorg-dead-field-eliminate.c
@@ -2084,26 +2084,22 @@ rewrite_pointer_plus_def_rhs (gimple *stmt, gimple_stmt_iterator &gsi, tree lhs,
tree integer_constant = is_op1_int_cst ? op1 : op0;
bool has_integer_constant = (TREE_CODE (integer_constant) == INTEGER_CST);
- // I want to know if this is an invariant.
if (has_integer_constant)
+ {
+ // I want to know if this is an invariant.
+ // TODO: Outline
gcc_assert (TREE_CODE (op1) == INTEGER_CST);
-
- switch (has_integer_constant)
- {
- case true:
- {
- tree pointer = is_op1_int_cst ? op0 : op1;
- tree pointer_type = TREE_TYPE (pointer);
- tree new_constant
+ tree pointer = is_op1_int_cst ? op0 : op1;
+ tree pointer_type = TREE_TYPE (pointer);
+ tree new_constant
= rewrite_pointer_plus_def_rhs_integer_constant (pointer,
integer_constant,
old_type);
- unsigned int operand = is_op1_int_cst ? 2 : 1;
- gimple_set_op (stmt, operand, new_constant);
- }
- break;
- case false:
- {
+ unsigned int operand = is_op1_int_cst ? 2 : 1;
+ gimple_set_op (stmt, operand, new_constant);
+ return true;
+ }
+
tree variable = op1;
tree pointer = op0;
// I want to know if this is an invariant.
@@ -2117,12 +2113,6 @@ rewrite_pointer_plus_def_rhs (gimple *stmt, gimple_stmt_iterator &gsi, tree lhs,
unsigned int operand
= TREE_CODE (TREE_TYPE (op0)) == POINTER_TYPE ? 2 : 1;
gimple_set_op (stmt, operand, new_variable);
- }
- break;
- default:
- gcc_unreachable ();
- break;
- }
return true;
}