------- Comment #28 from joel at gcc dot gnu dot org 2009-01-20 15:55 -------
I am starting a test sweep with this patch applied.
I will report back when the testing is done.
Thanks.
--joel
(In reply to comment #27)
> (In reply to comment #26)
> > Well, ISTR something about local variables need to be marked volatile if you
> > use setjmp/longjmp. Is psim really in compliance with what the standard
> > says
> > here? See 7.13.2.1/3 "..., except that the values of objects of automatic
> > storage duration that are local to the function containing the invocation
> > of the corresponding setjmp macro that do not have volatile-qualified type
> > and
> > have been changed between the setjmp invocation and longjmp call are
> > indeterminate"
> >
>
> This patch for sim:
> Index: sim/ppc/gen-idecode.c
> ===================================================================
> RCS file: /cvs/src/src/sim/ppc/gen-idecode.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 gen-idecode.c
> --- sim/ppc/gen-idecode.c 19 Jun 2003 18:42:30 -0000 1.4
> +++ sim/ppc/gen-idecode.c 20 Jan 2009 15:48:18 -0000
> @@ -708,11 +708,11 @@ print_run_until_stop_body(lf *file,
> }
> lf_putstr(file, "int last_cpu;\n");
> if (generate_smp) {
> - lf_putstr(file, "int current_cpu;\n");
> + lf_putstr(file, "volatile int current_cpu;\n");
> }
>
> if ((code & generate_with_icache)) {
> - lf_putstr(file, "int cpu_nr;\n");
> + lf_putstr(file, "volatile int cpu_nr;\n");
> lf_putstr(file, "\n");
> lf_putstr(file, "/* flush the icache of a possible break insn */\n");
> lf_putstr(file, "for (cpu_nr = 0; cpu_nr < nr_cpus; cpu_nr++)\n");
>
> seems to work for me.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38587