Re: [patch, libfortran] Fix PR 123446, broken bootstrap

Steve Kargl <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
On Thu, Jan 08, 2026 at 09:42:53PM +0100, Thomas Koenig wrote:
> Am 08.01.26 um 16:56 schrieb Hans-Peter Nilsson:
> > > From: Hans-Peter Nilsson <[email protected]>
> > > Date: Thu, 8 Jan 2026 09:01:56 +0100
> > 
> > > That appears to do it!  With your "p3a.diff" patch applied
> > > to r16-6514 (i.e. in place of the faulty r16-6515), build is
> > > restored for cris-elf.  Test-results are not yet ready.
> > 
> > Test results are clean at r16-6514 + p3a.diff (i.e. no
> > regressions compared to r16-6514).  Thanks again for the
> > fix, I hope it gets committed soon.
> 
> Committed as r16-6586-gd5964a270de33349ff137b1835046e65ec81fa1e
> (this may be pushing obvious and simple for a bit, but I did want
> to get this out of the way as fast as possible).
> 
> Sorry for breaking bootstrap, and thanks a lot for the help!
> 

Unfortunately, it is still broken. (unit)->self has a type
of __gthread_t, which appears to be mapped to pthread_t
on FreeBSD, which is a struct pthread *.  

In file included from ../../../gcc/libgfortran/io/unit.c:30:
../../../gcc/libgfortran/io/unit.c: In function 'insert_unit':
../../../gcc/libgfortran/io/async.h:396:18: error: assignment to '__gthread_t' {aka 'struct pthread *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
  396 |     (unit)->self = 1;                                           \
      |                  ^
../../../gcc/libgfortran/io/unit.c:250:3: note: in expansion of macro 'LOCK_UNI'
  250 |   LOCK_UNIT (u);
      |   ^~~~~~~~~
../../../gcc/libgfortran/io/unit.c: In function 'check_for_recursive':
../../../gcc/libgfortran/io/async.h:436:13: error: assignment to 'int' from '__gthread_t' {aka 'struct pthread *'} makes integer from pointer without a cast [-Wint-conversion]
  436 |         res = (unit)->self;                                     \
      |             ^
../../../gcc/libgfortran/io/unit.c:366:19: note: in expansion of macro 'TRYLOCK_UNIT'
  366 |               if (TRYLOCK_UNIT(p))
      |                   ^~~~~~~~~~~~
../../../gcc/libgfortran/io/async.h:437:22: error: assignment to '__gthread_t' {aka 'struct pthread *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
  437 |         (unit)->self = 1;                                       \
      |                      ^
../../../gcc/libgfortran/io/unit.c:366:19: note: in expansion of macro 'TRYLOCK_ UNIT'                                                                            
  366 |               if (TRYLOCK_UNIT(p))                                       
      |                   ^~~~~~~~~~~~                                           
../../../gcc/libgfortran/io/async.h:558:66: error: pointer/integer type mismatch  in conditional expression [-Wint-conversion]                                    
  558 | #define OWN_THREAD_ID (__gthread_active_p () ? __gthread_self () : 1)    
      |                                                                  ^       
../../../gcc/libgfortran/io/unit.c:373:71: note: in expansion of macro 'OWN_THRE AD_ID'                                                                           
  373 |                   if (__atomic_load_n (&p->self, __ATOMIC_RELAXED) == OW N_THREAD_ID)
      |                                                                       ^~ ~~~~~~~~~~~
../../../gcc/libgfortran/io/unit.c: In function 'get_gfc_unit':                  
../../../gcc/libgfortran/io/async.h:436:13: error: assignment to 'int' from '__g thread_t' {aka 'struct pthread *'} makes integer from pointer without a cast [-W int-conversion]
  436 |         res = (unit)->self;                                     \        
      |             ^                                                            
../../../gcc/libgfortran/io/unit.c:450:13: note: in expansion of macro 'TRYLOCK_ UNIT'
  450 |       if (! TRYLOCK_UNIT (p))
      |             ^~~~~~~~~~~~
../../../gcc/libgfortran/io/async.h:437:22: error: assignment to '__gthread_t' {aka 'struct pthread *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
  437 |         (unit)->self = 1;                                       \
      |                      ^
../../../gcc/libgfortran/io/unit.c:450:13: note: in expansion of macro 'TRYLOCK_UNIT'
  450 |       if (! TRYLOCK_UNIT (p))
      |             ^~~~~~~~~~~~
../../../gcc/libgfortran/io/async.h:396:18: error: assignment to '__gthread_t' {aka 'struct pthread *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
  396 |     (unit)->self = 1;                                           \
      |                  ^
../../../gcc/libgfortran/io/unit.c:465:7: note: in expansion of macro 'LOCK_UNI'
  465 |       LOCK_UNIT (p);
      |       ^~~~~~~~~

-- 
Steve
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.