This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/79674] Missed optimisation when no sequence point present
- From: "prathamesh3492 at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Feb 2017 13:51:32 +0000
- Subject: [Bug c/79674] Missed optimisation when no sequence point present
- Auto-submitted: auto-generated
- References: <bug-79674-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79674
prathamesh3492 at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |prathamesh3492 at gcc dot gnu.org
--- Comment #1 from prathamesh3492 at gcc dot gnu.org ---
Well since vol_str is qualified with volatile, I suppose optimizations were
suppressed. After removing volatile, the store-merging pass converted four byte
writes into a single 32-bit write for both fct1 and fct2 as can be seen from
the dump below:
;; Function fct1 (fct1, funcdef_no=1, decl_uid=1804, cgraph_uid=1,
symbol_order=2)
Coalescing successful!
Merged into 1 stores
New sequence of 1 stmts to replace old one of 4 stmts
Merging successful!
fct1 ()
{
<bb 2> [100.00%]:
MEM[(unsigned char *)&vol_str] = 197121;
return;
}
;; Function fct2 (fct2, funcdef_no=2, decl_uid=1807, cgraph_uid=2,
symbol_order=3)
Coalescing successful!
Merged into 1 stores
New sequence of 1 stmts to replace old one of 4 stmts
Merging successful!
fct2 ()
{
<bb 2> [100.00%]:
MEM[(unsigned char *)&vol_str] = 197121;
return;
}
Thanks,
Prathamesh