public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: GCC Development <gcc@gcc.gnu.org>
Subject: _Unwind_Resume() references in libgcc division functions
Date: Tue, 21 Jun 2022 15:13:19 +0200	[thread overview]
Message-ID: <0da8d95f-7102-4324-2737-82ff3c4b7e27@embedded-brains.de> (raw)

Hello,

I noticed that several division related routines provided by libgcc such 
as __divdi3, __moddi3 and __umoddi3 have references to _Unwind_Resume 
for the sparc-rtems target. For example:

	.file	"libgcc2.c"
! GNU C17 (GCC) version 13.0.0 20220621 (experimental) [master 
r13-1187-gab981aab92c] (sparc-rtems6)
!	compiled by GNU C version 12.1.1 20220517 [revision 
325d82b08696da17fb26bd2e1b6ba607649357fb], GMP version 6.1.0, MPFR 
version 3.1.4, MPC version 1.0.3, isl version isl-0.16.1-GMP

! GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
! options passed: -msoft-float -mcpu=leon3 -g -g -g -O0 -O2 -O0 
-fbuilding-libgcc -fno-stack-protector -fexceptions 
-fnon-call-exceptions -fvisibility=hidden

.LLBE7:
.LLBE6:
! /home/EB/sebastian_h/src/gcc/libgcc/libgcc2.c:1225:   w = __udivmoddi4 
(uu.ll, vv.ll, (UDWtype *) 0);
	.loc 1 1225 5
	std	%g2, [%fp-16]	! D.3900, w
! /home/EB/sebastian_h/src/gcc/libgcc/libgcc2.c:1226:   if (c)
	.loc 1 1226 6
	ld	[%fp-4], %g1	! c, tmp284
	cmp	%g1, 0	! tmp284,
	be	.LL25
	 nop		!
	b	.LL28
	 nop	!
.LL27:
	mov	%i0, %g1	!, tmp283
	mov	%g1, %o0	! D.3909,
.LLEHB2:
	call	_Unwind_Resume, 0
	 nop	!,
.LL28:

Could someone please give me a hint, why the compiler generates this 
code? I was unable to figure this out by looking at the pre-processed 
code. I tried to reproduce it with a simple division by zero test case, 
but this didn't work:

unsigned f(unsigned i)
{
         return i / 0;
}

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

             reply	other threads:[~2022-06-21 13:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21 13:13 Sebastian Huber [this message]
2022-06-21 13:24 ` Jakub Jelinek
2022-06-21 13:44   ` Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0da8d95f-7102-4324-2737-82ff3c4b7e27@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).