https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110683
Bug ID: 110683 Summary: wrong code with '-O2' and specific optimizations Product: gcc Version: 12.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: 19373742 at buaa dot edu.cn Target Milestone: --- Created attachment 55551 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55551&action=edit The preprocessed file ******************************************************************************* OS and Platform: CentOS Linux release 7.9.2009 (Core), x86_64 GNU/Linux ******************************************************************************* gcc version: /home/gcc-releases/gcc-12-0707/bin/gcc -v Using built-in specs. COLLECT_GCC=/home/gcc-releases/gcc-12-0707/bin/gcc COLLECT_LTO_WRAPPER=/home/gcc-releases/gcc-12-0707/libexec/gcc/x86_64-pc-linux-gnu/12.3.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ./configure --prefix=/home/gcc-releases/gcc-12-0707/ --disable-multilib --enable-language=c,c++ Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.3.1 20230707 (GCC) ******************************************************************************* Command Lines: # /home/gcc-releases/gcc-12-0707/bin/gcc -I /home/csmith_record/include/csmith-2.3.0/ -O2 -fno-aggressive-loop-optimizations -fno-align-functions -fno-align-jumps -fno-align-labels -fno-align-loops -fno-allocation-dce -fno-asynchronous-unwind-tables -fno-auto-inc-dec -fno-bit-tests -fno-branch-count-reg -fno-caller-saves -fno-code-hoisting -fno-combine-stack-adjustments -fno-compare-elim -fno-cprop-registers -fno-crossjumping -fno-cse-follow-jumps -fno-dce -fno-defer-pop -fno-devirtualize -fno-devirtualize-speculatively -fno-dse -fno-early-inlining -fno-expensive-optimizations -fno-forward-propagate -fno-fp-int-builtin-inexact -fno-function-cse -fno-gcse -fno-gcse-after-reload -fno-gcse-lm -fno-guess-branch-probability -fno-hoist-adjacent-loads -fno-if-conversion -fno-if-conversion2 -fno-indirect-inlining -fno-inline -fno-inline-atomics -fno-inline-functions -fno-inline-functions-called-once -fno-inline-small-functions -fno-ipa-bit-cp -fno-ipa-cp -fno-ipa-cp-clone -fno-ipa-icf -fno-ipa-icf-functions -fno-ipa-icf-variables -fno-ipa-modref -fno-ipa-profile -fno-ipa-pure-const -fno-ipa-ra -fno-ipa-reference -fno-ipa-reference-addressable -fno-ipa-sra -fno-ipa-stack-alignment -fno-ipa-strict-aliasing -fno-ipa-vrp -fno-ira-hoist-pressure -fno-ira-share-save-slots -fno-ira-share-spill-slots -fno-isolate-erroneous-paths-dereference -fno-ivopts -fno-jump-tables -fno-lifetime-dse -fno-loop-interchange -fno-loop-unroll-and-jam -fno-lra-remat -fno-math-errno -fno-move-loop-invariants -fno-move-loop-stores -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-optimize-strlen -fno-partial-inlining -fno-peel-loops -fno-peephole -fno-peephole2 -fno-plt -fno-predictive-commoning -fno-printf-return-value -fno-ree -fno-reg-struct-return -fno-reorder-blocks -fno-reorder-blocks-and-partition -fno-reorder-functions -fno-rerun-cse-after-loop -fno-sched-critical-path-heuristic -fno-sched-dep-count-heuristic -fno-sched-group-heuristic -fno-sched-interblock -fno-sched-last-insn-heuristic -fno-sched-rank-heuristic -fno-sched-spec -fno-sched-spec-insn-heuristic -fno-sched-stalled-insns-dep -fno-schedule-fusion -fno-schedule-insns2 -fno-semantic-interposition -fno-short-enums -fno-shrink-wrap -fno-shrink-wrap-separate -fno-signed-zeros -fno-split-ivs-in-unroller -fno-split-loops -fno-split-paths -fno-split-wide-types -fno-ssa-backprop -fno-ssa-phiopt -fno-stdarg-opt -fno-store-merging -fno-strict-aliasing -fno-thread-jumps -fno-toplevel-reorder -fno-trapping-math -fno-tree-bit-ccp -fno-tree-builtin-call-dce -fno-tree-ccp -fno-tree-ch -fno-tree-coalesce-vars -fno-tree-copy-prop -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-forwprop -fno-tree-fre -fno-tree-loop-distribute-patterns -fno-tree-loop-distribution -fno-tree-loop-im -fno-tree-loop-ivcanon -fno-tree-loop-optimize -fno-tree-loop-vectorize -fno-tree-partial-pre -fno-tree-phiprop -fno-tree-pre -fno-tree-pta -fno-tree-reassoc -fno-tree-scev-cprop -fno-tree-sink -fno-tree-slp-vectorize -fno-tree-slsr -fno-tree-sra -fno-tree-switch-conversion -fno-tree-tail-merge -fno-tree-ter -fno-tree-vrp -fno-unroll-completely-grow-size -fno-unswitch-loops -fno-unwind-tables -fno-version-loops-for-strides -fno-allow-store-data-races -fno-associative-math -fno-branch-probabilities -fno-conserve-stack -fno-cx-fortran-rules -fno-cx-limited-range -fno-delayed-branch -fno-delete-dead-exceptions -fno-exceptions -fno-finite-loops -fno-finite-math-only -fno-float-store -fno-gcse-las -fno-gcse-sm -fno-graphite -fno-graphite-identity -fno-harden-compares -fno-harden-conditional-branches -fno-ipa-pta -fno-ira-loop-pressure -fno-isolate-erroneous-paths-attribute -fno-keep-gc-roots-live -fno-limit-function-alignment -fno-live-range-shrinkage -fno-loop-nest-optimize -fno-loop-parallelize-all -fno-modulo-sched -fno-modulo-sched-allow-regmoves -fno-non-call-exceptions -fno-opt-info -fno-pack-struct -fno-profile-partial-training -fno-profile-reorder-functions -fno-reciprocal-math -fno-rename-registers -fno-reschedule-modulo-scheduled-loops -fno-rounding-math -fno-save-optimization-record -fno-sched-pressure -fno-sched-spec-load -fno-sched-spec-load-dangerous -fno-sched-stalled-insns -fno-sched2-use-superblocks -fno-schedule-insns -fno-section-anchors -fno-sel-sched-pipelining -fno-sel-sched-pipelining-outer-loops -fno-sel-sched-reschedule-pipelined -fno-short-wchar -fno-signaling-nans -fno-single-precision-constant -fno-split-wide-types-early -fno-stack-clash-protection -fno-tracer -fno-trapv -fno-tree-cselim -fno-tree-lrs -fno-tree-vectorize -fno-unconstrained-commons -fno-unroll-all-loops -fno-unroll-loops -fno-unsafe-math-optimizations -fno-var-tracking -fno-var-tracking-assignments -fno-var-tracking-assignments-toggle -fno-var-tracking-uninit -fno-variable-expansion-in-unroller -fno-vpt -fno-web -fno-wrapv -fno-wrapv-pointer -gno-statement-frontiers -fno-aggressive-loop-optimizations -falign-functions -falign-jumps -fno-align-labels -fno-align-loops -fno-allocation-dce -fasynchronous-unwind-tables -fauto-inc-dec -fno-bit-tests -fbranch-count-reg -fcaller-saves -fno-code-hoisting -fno-combine-stack-adjustments -fno-compare-elim -fno-cprop-registers -fno-crossjumping -fno-cse-follow-jumps -fdce -fdefer-pop -fno-devirtualize -fno-devirtualize-speculatively -fno-dse -fearly-inlining -fno-expensive-optimizations -fforward-propagate -ffp-int-builtin-inexact -ffunction-cse -fno-gcse -fgcse-after-reload -fgcse-lm -fguess-branch-probability -fno-hoist-adjacent-loads -fif-conversion -fif-conversion2 -findirect-inlining -finline -finline-atomics -finline-functions -finline-functions-called-once -fno-inline-small-functions -fipa-bit-cp -fno-ipa-cp -fipa-cp-clone -fno-ipa-icf -fipa-icf-functions -fipa-icf-variables -fipa-modref -fno-ipa-profile -fipa-pure-const -fno-ipa-ra -fipa-reference -fno-ipa-reference-addressable -fno-ipa-sra -fipa-stack-alignment -fipa-strict-aliasing -fno-ipa-vrp -fira-hoist-pressure -fno-ira-share-save-slots -fira-share-spill-slots -fisolate-erroneous-paths-dereference -fno-ivopts -fno-jump-tables -flifetime-dse -floop-interchange -fno-loop-unroll-and-jam -fno-lra-remat -fmath-errno -fno-move-loop-invariants -fmove-loop-stores -fomit-frame-pointer -fno-optimize-sibling-calls -fno-optimize-strlen -fno-partial-inlining -fno-peel-loops -fpeephole -fpeephole2 -fplt -fno-predictive-commoning -fno-printf-return-value -fno-ree -freg-struct-return -fno-reorder-blocks -freorder-blocks-and-partition -freorder-functions -fno-rerun-cse-after-loop -fsched-critical-path-heuristic -fsched-dep-count-heuristic -fsched-group-heuristic -fno-sched-interblock -fno-sched-last-insn-heuristic -fno-sched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic -fno-sched-stalled-insns-dep -fschedule-fusion -fschedule-insns2 -fsemantic-interposition -fshort-enums -fno-shrink-wrap -fno-shrink-wrap-separate -fno-signed-zeros -fno-split-ivs-in-unroller -fsplit-loops -fno-split-paths -fno-split-wide-types -fno-ssa-backprop -fno-ssa-phiopt -fno-stdarg-opt -fstore-merging -fno-strict-aliasing -fthread-jumps -fno-toplevel-reorder -fno-trapping-math -fno-tree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -fno-tree-ch -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts -fno-tree-dse -fno-tree-forwprop -ftree-fre -ftree-loop-distribute-patterns -ftree-loop-distribution -ftree-loop-im -ftree-loop-ivcanon -fno-tree-loop-optimize -ftree-loop-vectorize -ftree-partial-pre -ftree-phiprop -fno-tree-pre -ftree-pta -ftree-reassoc -fno-tree-scev-cprop -ftree-sink -fno-tree-slp-vectorize -ftree-slsr -ftree-sra -fno-tree-switch-conversion -ftree-tail-merge -fno-tree-ter -ftree-vrp -funroll-completely-grow-size -fno-unswitch-loops -fno-unwind-tables -fversion-loops-for-strides -fno-allow-store-data-races -fassociative-math -fbranch-probabilities -fno-conserve-stack -fno-cx-fortran-rules -fno-cx-limited-range -fdelayed-branch -fdelete-dead-exceptions -fno-exceptions -fno-finite-loops -ffinite-math-only -fno-float-store -fno-gcse-las -fgcse-sm -fno-graphite -fgraphite-identity -fharden-compares -fharden-conditional-branches -fno-ipa-pta -fno-ira-loop-pressure -fno-isolate-erroneous-paths-attribute -fkeep-gc-roots-live -fno-limit-function-alignment -fno-live-range-shrinkage -fno-loop-nest-optimize -fno-loop-parallelize-all -fno-modulo-sched -fno-modulo-sched-allow-regmoves -fnon-call-exceptions -fno-opt-info -fpack-struct -fno-profile-partial-training -fno-profile-reorder-functions -freciprocal-math -fno-rename-registers -freschedule-modulo-scheduled-loops -frounding-math -fno-save-optimization-record -fsched-pressure -fsched-spec-load -fsched-spec-load-dangerous -fno-sched-stalled-insns -fsched2-use-superblocks -fno-schedule-insns -fno-section-anchors -fno-sel-sched-pipelining -fno-sel-sched-pipelining-outer-loops -fsel-sched-reschedule-pipelined -fno-short-wchar -fno-signaling-nans -fsingle-precision-constant -fno-split-wide-types-early -fno-stack-clash-protection -fno-tracer -ftrapv -fno-tree-cselim -fno-tree-lrs -fno-tree-vectorize -fno-unconstrained-commons -funroll-all-loops -funroll-loops -fno-unsafe-math-optimizations -fvar-tracking -fvar-tracking-assignments -fno-var-tracking-assignments-toggle -fno-var-tracking-uninit -fvariable-expansion-in-unroller -fno-vpt -fweb -fno-wrapv -fwrapv-pointer -gstatement-frontiers -save-temps ms.c -o m3.o 2>m3.txt # /home/gcc-releases/gcc-12-0707/bin/gcc -I /home/csmith/include/csmith-2.3.0/ ms.c -o m4.o # ./m4.o checksum = 16499F41 # ./m3.o checksum = 187B9F46