https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92643

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Sun, Nov 24, 2019 at 03:59:41AM +0000, kargl at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92643
> 
> --- Comment #1 from kargl at gcc dot gnu.org ---
> % gdb831 ./z
> (gdb) run
> Starting program: /usr/home/kargl/tmp/z 
> 
> Program received signal SIGSEGV, Segmentation fault.
> main () at ISO_Fortran_binding_15.c:29
> 29        if (*(int *)dat.base_addr != 42)
> 
> 
> I think that there is a 32-bit vs 64-bit problem with pointers.
> 

A little more debugging,

(gdb) b ISO_Fortran_binding_15.c:29
Breakpoint 1 at 0x804898d: file ISO_Fortran_binding_15.c, line 29.
(gdb) run ./z
Starting program: /usr/home/kargl/tmp/z ./z

Breakpoint 1, main () at ISO_Fortran_binding_15.c:29
29        if (*(int *)dat.base_addr != 42)
(gdb) p dat
$1 = {base_addr = 0x0, elem_len = 4, version = 1, rank = 0 '\000', 
  attribute = 1 '\001', type = 1025, dim = {{lower_bound = -4200908, 
      extent = 677138155, sm = 1}}}

So, we find

typedef struct CFI_cdesc_t
 {
    void *base_addr;
    size_t elem_len;
    int version;
    CFI_rank_t rank;
    CFI_attribute_t attribute;
    CFI_type_t type;
    CFI_dim_t dim[];
 }
CFI_cdesc_t;

Whoops that 'void *' is likely the problem.  sizeof(void *)
on i586-*-freebsd is 4; while it is 8 on x86_64-*-amd64.  I
suspect a missing a "fold_convert(pvoid_type_node,...)"

Reply via email to