2003-04-16 Roger Sayle <roger@eyesopen.com>
commit3b584d94523d32aeb6c79c27460989c942401cad
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Apr 2003 01:22:51 +0000 (17 01:22 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Apr 2003 01:22:51 +0000 (17 01:22 +0000)
tree44b4d881f76561d90d3775b429d23bd5cec3c3fa
parent650e773f9b655c427dbed851fa37ba53d30b3279
2003-04-16  Roger Sayle  <roger@eyesopen.com>

* c-semantics.c (find_reachable_label): New function to find a
potentially reachable label in an expression.
(expand_unreachable_if_stmt): Similar to expand_if_stmt but
assumes the start of the IF_STMT is unreachable (dead) code.
(expand_unreachable_stmt): Similar to expand_stmt but assumes
the start of the statement list is unreachable (dead) code.
(genrtl_if_stmt):  If the controlling expression of the IF
is constant, use expand_unreachable_stmt for the THEN or ELSE
clause as appropriate.
(genrtl_switch_stmt):  Use expand_unreachable_stmt to expand
the body of a SWITCH statement.
(expand_stmt): The code immediately following a "return",
"break", "continue" or "goto" is unreachable.
* Makefile.in (c-semantics.o): Depend upon tree-inline.h.

* gcc.dg/Wunreachable-5.c: New test case for PR c/10175.
* gcc.c-torture/execute/medce-1.c: New test case.
* gcc.c-torture/execute/medce-2.c: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65715 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/Makefile.in
gcc/c-semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/medce-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/medce-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wunreachable-5.c [new file with mode: 0644]