------- Comment #20 from drab at kepler dot fjfi dot cvut dot cz 2006-01-16 03:25 ------- (In reply to comment #18) > (In reply to comment #17) > > Yes, it is unnecessary, but not wrong, since if you take a closer look, it > > is > > just > > Actually it is wrong as it is in read only memory. > > (insn:TI 412 535 40 ../../gcc/opts.c:1301 (set (mem/u/c/i:SI (symbol_ref:SI > ("cl_options_count") [flags 0x40] <var_decl 0xb7bd8160 cl_options_count>) [3 > cl_options_count+0 S4 A32]) > (reg:SI 3 bx [orig:143 cl_options_count ] [143])) 34 {*movsi_1} (nil) > (expr_list:REG_EQUIV (mem/u/c/i:SI (symbol_ref:SI ("cl_options_count") > [flags 0x40] <var_decl 0xb7bd8160 cl_options_count>) [3 cl_options_count+0 S4 > A32]) > (nil)))
I assume this means "read-only" just as a hint for the compiler, right? Not that it would really actually reside in a "read-only" memory. So the writing should not cause the segfault. It is the memset that causes the segfault, no? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25636