public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/65716] New: Integral promotion wrong with arm version
@ 2015-04-09 15:18 juan-antonio.garcia@nabla-designs.com
  2015-04-09 16:41 ` [Bug c/65716] " jakub at gcc dot gnu.org
  2015-04-10  5:16 ` juan-antonio.garcia@nabla-designs.com
  0 siblings, 2 replies; 3+ messages in thread
From: juan-antonio.garcia@nabla-designs.com @ 2015-04-09 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65716
           Summary: Integral promotion wrong with arm version
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juan-antonio.garcia@nabla-designs.com

Created attachment 35277
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35277&action=edit
Compiler output to gcc -v -save-temps

test.c:

int main()
{
  char a =-1;
  int b = a;

  while(b>0);

  return 0;
}

This program has different behaviour in i386 and arm architectures.

i386 : The program exits normally.

arm  : The program loops for ever because evaluates b > 0.

******************************************************************
test.i:

# 1 "test.c"
# 1 "<interno>"
# 1 "<línea-de-orden>"
# 1 "test.c"
int main()
{
  char a =-1;
  int b = a;

  while(b>0);

  return 0;
}

********************************************************************

test.s:

    .syntax unified
    .arch armv7-a
    .eabi_attribute 27, 3
    .fpu vfpv3-d16
    .eabi_attribute 20, 1
    .eabi_attribute 21, 1
    .eabi_attribute 23, 3
    .eabi_attribute 24, 1
    .eabi_attribute 25, 1
    .eabi_attribute 26, 2
    .eabi_attribute 30, 6
    .eabi_attribute 34, 1
    .eabi_attribute 18, 4
    .thumb
    .file    "test.c"
    .text
    .align    2
    .global    main
    .thumb
    .thumb_func
    .type    main, %function
main:
    @ args = 0, pretend = 0, frame = 8
    @ frame_needed = 1, uses_anonymous_args = 0
    @ link register save eliminated.
    push    {r7}
    sub    sp, sp, #12
    add    r7, sp, #0
    mov    r3, #255
    strb    r3, [r7, #7]
    ldrb    r3, [r7, #7]    @ zero_extendqisi2
    str    r3, [r7, #0]
.L2:
    ldr    r3, [r7, #0]
    cmp    r3, #0
    bgt    .L2
    mov    r3, #0
    mov    r0, r3
    add    r7, r7, #12
    mov    sp, r7
    pop    {r7}
    bx    lr
    .size    main, .-main
    .ident    "GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3"
    .section    .note.GNU-stack,"",%progbits
>From gcc-bugs-return-483156-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Apr 09 15:19:14 2015
Return-Path: <gcc-bugs-return-483156-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 34271 invoked by alias); 9 Apr 2015 15:19:14 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 34224 invoked by uid 48); 9 Apr 2015 15:19:11 -0000
From: "ro at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/65717] 64-bit runtime FAILs with 32-bit compiler
Date: Thu, 09 Apr 2015 15:19:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: go
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ro at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ian at airs dot com
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: target_milestone
Message-ID: <bug-65717-4-8kWCxyzV2W@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65717-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65717-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-04/txt/msg00708.txt.bz2
Content-length: 284

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide717

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/65716] Integral promotion wrong with arm version
  2015-04-09 15:18 [Bug c/65716] New: Integral promotion wrong with arm version juan-antonio.garcia@nabla-designs.com
@ 2015-04-09 16:41 ` jakub at gcc dot gnu.org
  2015-04-10  5:16 ` juan-antonio.garcia@nabla-designs.com
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-09 16:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Why do you think that is a bug?  AFAIK ARM is one of the many targets where
char is unsigned by default, while i?86/x86_64 is one of the many targets where
char is signed.  Use signed char explicitly if you rely on signed chars.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/65716] Integral promotion wrong with arm version
  2015-04-09 15:18 [Bug c/65716] New: Integral promotion wrong with arm version juan-antonio.garcia@nabla-designs.com
  2015-04-09 16:41 ` [Bug c/65716] " jakub at gcc dot gnu.org
@ 2015-04-10  5:16 ` juan-antonio.garcia@nabla-designs.com
  1 sibling, 0 replies; 3+ messages in thread
From: juan-antonio.garcia@nabla-designs.com @ 2015-04-10  5:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Juan Antonio Garcia <juan-antonio.garcia@nabla-designs.com> ---
Sorry for the noise, I didn't know that.

Regards,
    Juan Antonio
On 09/04/15 16:41, jakub at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65716
> 
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |RESOLVED
>                  CC|                            |jakub at gcc dot gnu.org
>          Resolution|---                         |INVALID
> 
> --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Why do you think that is a bug?  AFAIK ARM is one of the many targets where
> char is unsigned by default, while i?86/x86_64 is one of the many targets where
> char is signed.  Use signed char explicitly if you rely on signed chars.
> 
> -- 
> You are receiving this mail because:
> You reported the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-10  5:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-09 15:18 [Bug c/65716] New: Integral promotion wrong with arm version juan-antonio.garcia@nabla-designs.com
2015-04-09 16:41 ` [Bug c/65716] " jakub at gcc dot gnu.org
2015-04-10  5:16 ` juan-antonio.garcia@nabla-designs.com

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).