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] |
I think the subject says what causes the problem and the reason why we don't fold *&a into a[0] is because fold does not handle it but fold_stmt does. So what I did was to patch remove_useless_stmts_1 to do the folding for us (this is already done for the second testcase in the PR, for MODIFY_EXPR). I also removed the case for SWITCH_EXPR in remove_useless_stmts_1 because it was not needed at all and just slowed us down.
* tree-cfg.c (remove_useless_stmts_1) <case SWITCH_EXPR>: Don't fold statement. <case ASM_EXPR>: Fold the statement.
testsuite/ChangeLog: * gcc.c-torture/compile/pr17529.c: Remove the xfail.
Attachment:
temp.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] |