GCC ARM Improvement Project

Department of Software Engineering, University of Szeged


Glibc-2.2.5 error when compiled with gcc-20030310

Contents of this page:

gcc-help thread

Offlist thread

glibc GNATS PR

Offlist thread


Gcc-help - thread index


Date: Mon, 24 Mar 2003 12:35:36 +0100
From: Tamas Gergely (gertom@rgai.hu)
To: Philip Blundell (philb@gnu.org)
Subject: Error compiling glibc-2.3.1 with gcc-20030310 snapshot.

Hello!

I'm Tamas Gergely, and I'm working on the comparison of gcc versions on arm
architecture. Currently I'm trying to compare gcc-3.2 with the 3.3-branch
snapshots on linux target. Using glibc 2.3.1 version I have a problem compiling
sysdeps/unix/sysv/linux/arm/sigaction.c:

../sysdeps/unix/sysv/linux/arm/sigaction.c: In function `__libc_sigaction':
../sysdeps/unix/sysv/linux/arm/sigaction.c:100: error: asm-specifier for
variable `_a1' conflicts with asm clobber list
../sysdeps/unix/sysv/linux/arm/sigaction.c:139: error: asm-specifier for
variable `_a1' conflicts with asm clobber list

This error check was introduced in the gcc 3.3 branch
(http://gcc.gnu.org/ml/gcc/2002-09/msg00741.html).

The part of the source code is:
---
      result = INLINE_SYSCALL (rt_sigaction, 4, sig,
               act ? __ptrvalue (&kact) : NULL,
               oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
---

The (formatted) part of the preprocessed file:
---
result = (
  {
    unsigned int _sys_result;
    {
      register int _a1 asm ("a1");
      register int _a4 asm ("a4") = (int) (64 / 8);
      register int _a3 asm ("a3") = (int) (oact ? (&koact) : ((void *)0));
      register int _a2 asm ("a2") = (int) (act ? (&kact) : ((void *)0));
      _a1 = (int) (sig);
      asm volatile (
        "swi    %1    @ syscall " "rt_sigaction"
        : "=r" (_a1)
        : "i" (((0x900000 +174))),"r" (_a1),"r" (_a2),"r" (_a3),"r" (_a4)
        : "a1", "memory");
      _sys_result = _a1;
    }
    if (_sys_result >= (unsigned int) -4095) {
      (*__errno_location ()) = (-_sys_result);
      _sys_result = (unsigned int) -1;
    }
    (int) _sys_result;
  }
);
---

The INLINE_SYSCALL macro is defined in sysdeps/unix/sysv/linux/arm/sysdep.h.
The error comes from the "asm volatile ( ... );" lines.

I sent a mail to bug-glibc list, there are no answers yet. I also sent a PR,
it was suspended: "Nobody seems to care about arm.  This is certainly true for
the regular contributors.  Until this changes there is nothing which will be done.".

I searched the ChangeLog files and found that You added the file where this macro is
defined. That's why I'm asking You to help me by answering my questions:

(1) Is that something wrong in glibc, or gcc is too strict reporting an error here?
Assuming that gcc is correct:
(2) Can this conflict be corrected by rewriting the INLINE_SYSCALL macro,
    (or some other macros that are used by INLINE_SYSCALL)?
(3) Would You mind giving me some tips on how to try to avoid this conflict?

Thanks,
gertom

Date: 24 Mar 2003 13:25:05 +0000
From: Philip Blundell (philb@gnu.org)
To: Tamas Gergely (gertom@rgai.hu)
Subject: Re: Error compiling glibc-2.3.1 with gcc-20030310 snapshot.

On Mon, 2003-03-24 at 11:35, Tamás Gergely wrote:

> (1) Is that something wrong in glibc, or gcc is too strict reporting an
> error here?
> Assuming that gcc is correct:
> (2) Can this conflict be corrected by rewriting the INLINE_SYSCALL macro,
> (or some other macros that are used by INLINE_SYSCALL)?
> (3) Would You mind giving me some tips on how to try to avoid this conflict?


It's a bug in glibc.  "a1" should not be in the clobber list, since it's
also mentioned as an output operand.

p.

2003-03-24  Philip Blundell  (philb@gnu.org)

	* sysdeps/unix/sysv/linux/arm/sysdep.h (INTERNAL_SYSCALL):
	Remove a1 from clobber list.

Index: sysdeps/unix/sysv/linux/arm/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/arm/sysdep.h,v
retrieving revision 1.22
diff -u -r1.22 sysdep.h
--- sysdeps/unix/sysv/linux/arm/sysdep.h	23 Mar 2003 19:42:22 -0000	1.22
+++ sysdeps/unix/sysv/linux/arm/sysdep.h	24 Mar 2003 13:23:16 -0000
@@ -174,7 +174,7 @@
        asm volatile ("swi	%1	@ syscall " #name	\
 		     : "=r" (_a1)				\
 		     : "i" (SYS_ify(name)) ASM_ARGS_##nr	\
-		     : "a1", "memory");				\
+		     : "memory");				\
        _sys_result = _a1;					\
      }								\
      (int) _sys_result; })

[glibc] PR:#4989
Date: Thu, 27 Mar 2003 11:10:30 +0100
From: Tamas Gergely (gertom@rgai.hu)
To:  (libc-gnats@gnu.org)
Subject: Re: libc/4989: Error compiling glibc for ARM target with gcc-20030310
 snapshot.

http://bugs.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=glibc&pr=4989

I'm forwarding a mail, in which Philip Blundell gives a patch that solves the problem:

---
On Mon, 2003-03-24 at 11:35, Tamás Gergely wrote:

> (1) Is that something wrong in glibc, or gcc is too strict reporting an
> error here?
> Assuming that gcc is correct:
> (2) Can this conflict be corrected by rewriting the INLINE_SYSCALL macro,
> (or some other macros that are used by INLINE_SYSCALL)?
> (3) Would You mind giving me some tips on how to try to avoid this conflict?


It's a bug in glibc.  "a1" should not be in the clobber list, since it's
also mentioned as an output operand.

p.

2003-03-24  Philip Blundell  (philb@gnu.org)

    * sysdeps/unix/sysv/linux/arm/sysdep.h (INTERNAL_SYSCALL):
    Remove a1 from clobber list.

Index: sysdeps/unix/sysv/linux/arm/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/arm/sysdep.h,v
retrieving revision 1.22
diff -u -r1.22 sysdep.h
--- sysdeps/unix/sysv/linux/arm/sysdep.h    23 Mar 2003 19:42:22 -0000    1.22
+++ sysdeps/unix/sysv/linux/arm/sysdep.h    24 Mar 2003 13:23:16 -0000
@@ -174,7 +174,7 @@
        asm volatile ("swi    %1    @ syscall " #name    \
              : "=r" (_a1)                \
              : "i" (SYS_ify(name)) ASM_ARGS_##nr    \
-             : "a1", "memory");                \
+             : "memory");                \
        _sys_result = _a1;                    \
      }                                \
      (int) _sys_result; })
===================================================================

I think that the PR could be closed by applying this patch (if it has not been applied yet).

gertom

mail to webmaster
1970-01-01
© 2003 - 2012, University of Szeged
Valid XHTML 1.0!