On Sat, Jan 14, 2017 at 10:46 AM, Janne Blomqvist <blomqvist.ja...@gmail.com> wrote: > On Sat, Jan 14, 2017 at 1:13 AM, Jerry DeLisle <jvdeli...@charter.net> wrote: >> On 01/13/2017 11:46 AM, David Edelsohn wrote: >>> On Fri, Jan 13, 2017 at 12:09 PM, Janne Blomqvist >>> <blomqvist.ja...@gmail.com> wrote: >>>> On Thu, Jan 12, 2017 at 10:46 AM, FX <fxcoud...@gmail.com> wrote: >>>>>> I was finally able to get a 32-bit i686 compiler going (my attempts to >>>>>> do this on a x86_64-pc-linux-gnu host failed, in the end I resorted to >>>>>> running 32-bit builds/tests on a i686 container). At least on i686, >>>>>> the patch below on top of the big charlen->size_t patch fixes the >>>>>> failures >>>>> >>>>> Patch approved. The old code used gfc_extract_int, which bails out if a >>>>> non-constant expression is passed, so this is the right thing to do. >>>>> >>>>> FX >>>> >>>> Committed as r244448. >>>> >>>> David, can you verify that it works alright on ppc? >>> >>> Unfortunately, no. This patch broke bootstrap again with the same >>> failure as earlier. >>> >>> - David >>> >> >> Janne, can you access gcc112 on the compile farm? If not, I can, maybe I can >> test the patch. >> >> Jerry > > No, I don't have such access. I'd appreciate it very much if you'd > have a go at it. Attached is the r244448 patch combined with the > patch to fix the sanitizer bugs found by Dominique. > > -- > Janne Blomqvist
Since David had problems with module generation, I took a look at the parts of the patch that changes module.c, and found a few places for improvements. module.c is a collection of all the ugly type punning tricks one can think of, in particular wrongly punning to a wider type might cause a different result on a big endian machine, whereas on a little endian it would apparently just work.. So could you also try the attached small patch on top of the previous one? (I also sent Laurent Guerby an email requesting an account on the compile farm). -- Janne Blomqvist
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index ca53016..90b77ca 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -143,7 +143,7 @@ enum gfc_wsym_state typedef struct pointer_info { BBT_HEADER (pointer_info); - int integer; + HOST_WIDE_INT integer; pointer_t type; /* The first component of each member of the union is the pointer @@ -372,7 +372,7 @@ get_pointer (void *gp) creating the node if not found. */ static pointer_info * -get_integer (int integer) +get_integer (HOST_WIDE_INT integer) { pointer_info *p, t; int c; @@ -472,7 +472,7 @@ associate_integer_pointer (pointer_info *p, void *gp) sometime later. Returns the pointer_info structure. */ static pointer_info * -add_fixup (int integer, void *gp) +add_fixup (HOST_WIDE_INT integer, void *gp) { pointer_info *p; fixup_t *f; @@ -2729,7 +2729,8 @@ mio_pointer_ref (void *gp) if (iomode == IO_OUTPUT) { p = get_pointer (*((char **) gp)); - write_atom (ATOM_INTEGER, &p->integer); + HOST_WIDE_INT hwi = p->integer; + write_atom (ATOM_INTEGER, &hwi); } else { @@ -2766,18 +2767,18 @@ static void mio_component (gfc_component *c, int vtype) { pointer_info *p; - int n; mio_lparen (); if (iomode == IO_OUTPUT) { p = get_pointer (c); - mio_integer (&p->integer); + mio_hwi (&p->integer); } else { - mio_integer (&n); + HOST_WIDE_INT n; + mio_hwi (&n); p = get_integer (n); associate_integer_pointer (p, c); } @@ -5924,7 +5925,7 @@ write_symtree (gfc_symtree *st) mio_pool_string (&st->name); mio_integer (&st->ambiguous); - mio_integer (&p->integer); + mio_hwi (&p->integer); }