diff options
author | Martin Liska <mliska@suse.cz> | 2017-11-08 09:17:30 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-11-08 08:17:30 +0000 |
commit | 053ee6a774d6591cfc39f26e435e1912ddf8c54c (patch) | |
tree | aaf44db4400b6b1c323c2ece20c7f455909b4a69 /gcc/gimplify.c | |
parent | 5925290f7d809ce6622df64d68073522f7928761 (diff) | |
download | gcc-053ee6a774d6591cfc39f26e435e1912ddf8c54c.zip gcc-053ee6a774d6591cfc39f26e435e1912ddf8c54c.tar.gz gcc-053ee6a774d6591cfc39f26e435e1912ddf8c54c.tar.bz2 |
Fix fallthrough attribute ignorance w/ -fsanitize=address (PR sanitizer/82792).
2017-11-08 Martin Liska <mliska@suse.cz>
PR sanitizer/82792
* gimplify.c (expand_FALLTHROUGH_r): Skip IFN_ASAN_MARK.
2017-11-08 Martin Liska <mliska@suse.cz>
PR sanitizer/82792
* g++.dg/asan/pr82792.C: New test.
From-SVN: r254519
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index c4fd503..9563d82 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -2223,7 +2223,8 @@ expand_FALLTHROUGH_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, while (!gsi_end_p (gsi2)) { stmt = gsi_stmt (gsi2); - if (gimple_code (stmt) == GIMPLE_LABEL) + enum gimple_code gc = gimple_code (stmt); + if (gc == GIMPLE_LABEL) { tree label = gimple_label_label (as_a <glabel *> (stmt)); if (gimple_has_location (stmt) && DECL_ARTIFICIAL (label)) @@ -2232,8 +2233,11 @@ expand_FALLTHROUGH_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, break; } } + else if (gc == GIMPLE_CALL + && gimple_call_internal_p (stmt, IFN_ASAN_MARK)) + ; else - /* Something other than a label. That's not expected. */ + /* Something other is not expected. */ break; gsi_next (&gsi2); } |