https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124441
--- Comment #2 from Yushuai Xing <xingyushuai at hygon dot cn> ---
(In reply to Andrew Pinski from comment #1)
> Because that is yhe semantics of volatile
The extracted portion of the expand dump information is as follows::
;; basic block 2, loop depth 0
;; pred: ENTRY
# DEBUG BEGIN_STMT
# DEBUG ip => ip_p_14(D)
# DEBUG BEGIN_STMT
_1 = *tag_16(D);
literal_len_17 = _1 >> 2;
# DEBUG literal_len => literal_len_17
# DEBUG BEGIN_STMT
# DEBUG tag_type => _1
# DEBUG BEGIN_STMT
# DEBUG BEGIN_STMT
__asm__("and $3, %k0
" : "tag_type" "=r" tag_type_19, "=@ccz" is_literal_20 : "0" _1 :
"cc");
# DEBUG is_literal => is_literal_20
# DEBUG tag_type => tag_type_19
# DEBUG BEGIN_STMT
_2 = *ip_p_14(D);
_3 = literal_len_17 + 1;
_4 = (sizetype) _3;
_5 = _2 + _4;
_6 ={v} *_5;
# DEBUG tag_literal => (unsigned int) _6
# DEBUG BEGIN_STMT
_7 = (sizetype) tag_type_19;
_8 = _2 + _7;
_9 ={v} *_8;
tag_copy_22 = (unsigned int) _9;
# DEBUG tag_copy => tag_copy_22
# DEBUG BEGIN_STMT
if (is_literal_20 != 0)
goto <bb 3>; [50.00%]
else
goto <bb 4>; [50.00%]
;; succ: 3
;; 4
....
Replacing Expressions
_3 replace with --> _3 = literal_len_17 + 1;
_4 replace with --> _4 = (sizetype) _3;
_31 replace with --> _31 = literal_len_17 + 2;
_32 replace with --> _32 = (sizetype) _31;
_36 replace with --> _36 = _7 + 1;
In my opinion, variables _5 and _8 can be replaced because they are used to
calculate addresses, while variables _6 and _9 should not be replaced.