This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
There are two ways of fixing the problem here. The easy way is to teach block_may_fallthru of CLEAN_POINT_EXRP. The way is to remove statements after a return and gotos up till a label and then remove unused compiler generated labels (which is already a FIXME/???? in remove_useless_stmts_label. This patch does the earlier one and fixes the issue in the PR and actually saves one label/decl while compiling PR8361.
I have a separate patch which implements the first part of the second way of fixing the issue which I will submit for 4.2. It actually saves us from creating two basic blocks while compile PR 8361.
OK for 4.0 and mainline? Bootstrapped and tested on powerpc-darwin with no regressions.
Thanks, Andrew Pinski
testsuite/ChangeLog: * g++.dg/warn/Wreturn-3.C: New test
Attachment:
t.diff.txt
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |