public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/61847] bug in gfortran runtime: digits cut off when reading floating point number
Date: Mon, 03 Nov 2014 11:02:00 -0000	[thread overview]
Message-ID: <bug-61847-4-6Mp5r4SA1O@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61847-4@http.gcc.gnu.org/bugzilla/>

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #21 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #20)
> Created attachment 33858 [details]
> Proposed patch

  /* If the current locale is expecting a comma rather than a decimal
     point, convert it now.  */
  if (dtp->u.p.current_unit->decimal_locale == ',')
    *strchr (buffer, '.') = ',';

In principle, there are more options than just "," and "."; for instance, in
Britain, one often uses a centered dot (·) but that's not in the locale.

Looking at the output of all my locales, I found:
  ps_AF.utf8:     0٫400000
as the only locale which doesn't use either a '.' or a ','. Still, using a code
like the following looks more robust.

/* During _gfortran_st_read/write.  */
const char *curr_locale = setlocale(LC_ALL, NULL);
setlocale(LC_ALL, "C");

...

/* During _gfortran_st_read_done/write_done.  */
setlocale(LC_ALL, curr_locale);


* * *

Side remarks:

* Per PR36857 comment 8, it has to be "C" and not "POSIX" for MinGW.
* The fix for PR 36857 also assumes that there is only "," and "."; thus, when
going the setlocale route, it should be fixed as well.
* See also PR 47007; see also the variant using __strtold_l/strtold_l and
newlocale for READ (cf. PR 47007 comment 20 to 22).
>From gcc-bugs-return-465632-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Nov 03 11:06:17 2014
Return-Path: <gcc-bugs-return-465632-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10513 invoked by alias); 3 Nov 2014 11:06:16 -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 10494 invoked by uid 48); 3 Nov 2014 11:06:13 -0000
From: "jiwang at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/63721] New: [5 Regression] IPA ICF cause atomic-comp-swap-release-acquire.c ICE on arm
Date: Mon, 03 Nov 2014 11:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jiwang at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created
Message-ID: <bug-63721-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-11/txt/msg00104.txt.bz2
Content-length: 3289

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

            Bug ID: 63721
           Summary: [5 Regression] IPA ICF cause
                    atomic-comp-swap-release-acquire.c ICE on arm
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jiwang at gcc dot gnu.org

Created attachment 33875
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33875&action=edit
bug.i

start from revision 216305, and still exist on latest code 217035.

commit 52200d03c231f0bddbd4bbc5cd3608c6a1dd4598
Author: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Oct 16 10:47:55 2014 +0000

    IPA ICF pass, part 3/5

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216305
138bc75d-0d04-0410-961f-82ee72b054a4


cross configuration
===

    ../gcc/configure --target=arm-unknown-linux-gnueabihf --with-float=hard
--with-arch=armv7-a --with-tune=cortex-a15 --disable-multilib
--enable-languages=c,c++,fortran,java,lto,objc

compile command
===

  ./cc1 -O2 -fPIC bug.i -nostdinc
  (if specify -fno-ipa-icf then the ICE will go away)

backtrace
===

atomic-comp-swap-release-acquire.c: In function
‘atomic_compare_exchange_WEAK_RELEASE_ACQUIRE’:
atomic-comp-swap-release-acquire.c:7:0: error: invalid argument to gimple call

 ^
a
# .MEM_3 = VDEF <.MEM_1(D)>
retval.10_4 = atomic_compare_exchange_n_WEAK_RELEASE_ACQUIRE.localalias.0 (a,
b_2(D)); [tail call]

Breakpoint 2, internal_error (gmsgid=0x14ff2a8 "verify_gimple failed") at
../../gcc/gcc/diagnostic.c:1176
1176      va_start (ap, gmsgid);
(gdb) bt
#0  internal_error (gmsgid=0x14ff2a8 "verify_gimple failed") at
../../gcc/gcc/diagnostic.c:1176
#1  0x0000000000c8bc5d in verify_gimple_in_cfg (fn=0x7ffff6b097e0,
verify_nothrow=false) at ../../gcc/gcc/tree-cfg.c:5039
#2  0x0000000000b52b81 in execute_function_todo (fn=0x7ffff6b097e0, data=0x40)
at ../../gcc/gcc/passes.c:1758
#3  0x0000000000b51f12 in do_per_function (callback=0xb529db
<execute_function_todo(function*, void*)>, data=0x40) at
../../gcc/gcc/passes.c:1492
#4  0x0000000000b52d69 in execute_todo (flags=64) at
../../gcc/gcc/passes.c:1815
#5  0x0000000000b538cb in execute_one_pass (pass=0x1d0b0e0) at
../../gcc/gcc/passes.c:2172
#6  0x0000000000b5464e in execute_ipa_pass_list (pass=0x1d0b0e0) at
../../gcc/gcc/passes.c:2553
#7  0x00000000007db73f in ipa_passes () at ../../gcc/gcc/cgraphunit.c:2065
#8  0x00000000007db9e0 in symbol_table::compile (this=0x7ffff6c74000) at
../../gcc/gcc/cgraphunit.c:2145
#9  0x00000000007dbe52 in symbol_table::finalize_compilation_unit
(this=0x7ffff6c74000) at ../../gcc/gcc/cgraphunit.c:2298
#10 0x0000000000635abb in c_write_global_declarations () at
../../gcc/gcc/c/c-decl.c:10779
#11 0x0000000000c4ce74 in compile_file () at ../../gcc/gcc/toplev.c:582
#12 0x0000000000c4f19a in do_compile () at ../../gcc/gcc/toplev.c:1989
#13 0x0000000000c4f3a4 in toplev::main (this=0x7fffffffe49f, argc=5,
argv=0x7fffffffe598) at ../../gcc/gcc/toplev.c:2086
#14 0x00000000013a489a in main (argc=5, argv=0x7fffffffe598) at
../../gcc/gcc/main.c:38
(gdb)
>From gcc-bugs-return-465633-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Nov 03 11:14:03 2014
Return-Path: <gcc-bugs-return-465633-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13554 invoked by alias); 3 Nov 2014 11:14:02 -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 13461 invoked by uid 48); 3 Nov 2014 11:13:59 -0000
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
Date: Mon, 03 Nov 2014 11:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vries at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-63718-4-jxGuWhXzi2@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63718-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63718-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: 2014-11/txt/msg00105.txt.bz2
Content-length: 770

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

--- Comment #7 from vries at gcc dot gnu.org ---
(In reply to Joey Ye from comment #6)
> (In reply to vries from comment #5)
> > Could you try out the patch and see if it fixes things for you?
> >
> Tom, thanks for the quick action. Apparantly this patch should recover the
> bootstrap. I will test it and come back to you (bootstraping thumb1 with
> qemu takes hours!)
>

Great :)

> However, I think the fix is too conservative. There are plenty of chances
> that r0-r3 will not be clobbered by return. For example armv6-m will pretty
> much never uses r0-r3 implicitly.

Indeed, the patch is conservative, but that's not such a bad idea for a
correctness fix. We can always folllow up with a more optimal patch.


  parent reply	other threads:[~2014-11-03 11:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-61847-4@http.gcc.gnu.org/bugzilla/>
2014-07-19  6:19 ` [Bug fortran/61847] bug in gfortran runtime on OSX: " jvdelisle at gcc dot gnu.org
2014-07-21 15:41 ` e2cd58e1 at opayq dot com
2014-07-21 17:50 ` kargl at gcc dot gnu.org
2014-07-21 17:55 ` e2cd58e1 at opayq dot com
2014-07-21 17:58 ` kargl at gcc dot gnu.org
2014-07-21 18:18 ` e2cd58e1 at opayq dot com
2014-07-21 18:26 ` sgk at troutmask dot apl.washington.edu
2014-07-21 18:33 ` e2cd58e1 at opayq dot com
2014-07-21 19:50 ` [Bug fortran/61847] bug in gfortran runtime: " dominiq at lps dot ens.fr
2014-07-22  1:40 ` jvdelisle at gcc dot gnu.org
2014-07-22  2:07 ` e2cd58e1 at opayq dot com
2014-07-22  3:29 ` jvdelisle at gcc dot gnu.org
2014-07-22  4:28 ` jvdelisle at gcc dot gnu.org
2014-07-22  4:46 ` sgk at troutmask dot apl.washington.edu
2014-07-25 22:04 ` jvdelisle at gcc dot gnu.org
2014-08-02 21:12 ` jvdelisle at gcc dot gnu.org
2014-08-19 20:50 ` jb at gcc dot gnu.org
2014-11-03 11:02 ` burnus at gcc dot gnu.org [this message]
2014-11-04 12:35 ` jb at gcc dot gnu.org
2014-11-05 10:51 ` jb at gcc dot gnu.org
2014-11-10  0:18 ` jb at gcc dot gnu.org
2014-11-10  0:21 ` jb at gcc dot gnu.org

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=bug-61847-4-6Mp5r4SA1O@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).