public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/58690] New: internal compiler error: in copy_to_mode_reg, at explow.c:641
@ 2013-10-11 15:24 hjl.tools at gmail dot com
  2013-10-11 17:01 ` [Bug target/58690] " hjl.tools at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2013-10-11 15:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58690

            Bug ID: 58690
           Summary: internal compiler error: in copy_to_mode_reg, at
                    explow.c:641
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ubizjak at gmail dot com

[hjl@gnu-6 gcc]$ cat /tmp/foo.c
struct gomp_team_state
{
  void *team;
  void *work_share;
  void *last_work_share;
  unsigned team_id;
  unsigned level;
  unsigned active_level;
  unsigned place_partition_off;
  unsigned place_partition_len;
  unsigned long single_count;
  unsigned long static_trip;
};
struct gomp_thread
{
  void (*fn) (void *data);
  void *data;
  struct gomp_team_state ts;
};
extern __thread struct gomp_thread gomp_tls_data;
static inline struct gomp_thread *gomp_thread (void)
{
  return &gomp_tls_data;
}
void
foo (void)
{
  struct gomp_thread *thr = gomp_thread ();
  __builtin_memset (thr, '\0', sizeof (*thr));
}
[hjl@gnu-6 gcc]$ ./xgcc -B./ -mx32 -O /tmp/foo.c -S 
/tmp/foo.c: In function ‘foo’:
/tmp/foo.c:29:20: internal compiler error: in copy_to_mode_reg, at explow.c:641
   __builtin_memset (thr, '\0', sizeof (*thr));
                    ^
0x79cb0a copy_to_mode_reg(machine_mode, rtx_def*)
    /export/gnu/import/git/gcc/gcc/explow.c:641
0x79ca88 copy_addr_to_reg(rtx_def*)
    /export/gnu/import/git/gcc/gcc/explow.c:625
0xe27919 ix86_expand_setmem(rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*,
rtx_def*)
    /export/gnu/import/git/gcc/gcc/config/i386/i386.c:23439
0xeff035 gen_setmemsi(rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*,
rtx_def*)
    /export/gnu/import/git/gcc/gcc/config/i386/i386.md:15641
0x9f79f6 insn_gen_fn::operator()(rtx_def*, rtx_def*, rtx_def*, rtx_def*,
rtx_def*, rtx_def*) const
    /export/gnu/import/git/gcc/gcc/recog.h:288
0x9f7249 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
    /export/gnu/import/git/gcc/gcc/optabs.c:8227
0x9f73b6 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
    /export/gnu/import/git/gcc/gcc/optabs.c:8247
0x7b7f61 set_storage_via_setmem(rtx_def*, rtx_def*, rtx_def*, unsigned int,
unsigned int, long)
    /export/gnu/import/git/gcc/gcc/expr.c:2902
0x7b7926 clear_storage_hints(rtx_def*, rtx_def*, block_op_methods, unsigned
int, long)
    /export/gnu/import/git/gcc/gcc/expr.c:2748
0x669c97 expand_builtin_memset_args
    /export/gnu/import/git/gcc/gcc/builtins.c:3640
0x6697e4 expand_builtin_memset
    /export/gnu/import/git/gcc/gcc/builtins.c:3530
0x670d96 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
    /export/gnu/import/git/gcc/gcc/builtins.c:6111
0x7d2355 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**)
    /export/gnu/import/git/gcc/gcc/expr.c:10205
0x6b82a5 expand_call_stmt
    /export/gnu/import/git/gcc/gcc/cfgexpand.c:2182
0x6b839f expand_gimple_stmt_1
    /export/gnu/import/git/gcc/gcc/cfgexpand.c:2220
0x6b89ec expand_gimple_stmt
    /export/gnu/import/git/gcc/gcc/cfgexpand.c:2372
0x6bee5d expand_gimple_basic_block
    /export/gnu/import/git/gcc/gcc/cfgexpand.c:4211
0x6c08ec gimple_expand_cfg
    /export/gnu/import/git/gcc/gcc/cfgexpand.c:4730
0x6c0f76 execute
    /export/gnu/import/git/gcc/gcc/cfgexpand.c:4944
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-6 gcc]$
>From gcc-bugs-return-431491-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Oct 11 16:31:23 2013
Return-Path: <gcc-bugs-return-431491-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23078 invoked by alias); 11 Oct 2013 16:31:22 -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 23036 invoked by uid 48); 11 Oct 2013 16:31:19 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/58689] Enhance returns_nonnull
Date: Fri, 11 Oct 2013 16:31:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: diagnostic, missed-optimization
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: glisse 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:
Message-ID: <bug-58689-4-YqkTV8kFrd@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58689-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58689-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: 2013-10/txt/msg00635.txt.bz2
Content-length: 230

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX689

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
5) A warning that suggests adding the attribute to a function, when gcc can
detect that the return value is != 0.


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

* [Bug target/58690] internal compiler error: in copy_to_mode_reg, at explow.c:641
  2013-10-11 15:24 [Bug target/58690] New: internal compiler error: in copy_to_mode_reg, at explow.c:641 hjl.tools at gmail dot com
@ 2013-10-11 17:01 ` hjl.tools at gmail dot com
  2013-10-12 14:55 ` hjl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2013-10-11 17:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58690

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 30982
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30982&action=edit
A patch

In x32, when TLS address is in DImode and Pmode is SImode.
copy_addr_to_reg will fail. This patch adds ix86_copy_addr_to_reg
to generate SUBREG in this case.


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

* [Bug target/58690] internal compiler error: in copy_to_mode_reg, at explow.c:641
  2013-10-11 15:24 [Bug target/58690] New: internal compiler error: in copy_to_mode_reg, at explow.c:641 hjl.tools at gmail dot com
  2013-10-11 17:01 ` [Bug target/58690] " hjl.tools at gmail dot com
@ 2013-10-12 14:55 ` hjl at gcc dot gnu.org
  2013-10-14  8:58 ` rguenth at gcc dot gnu.org
  2013-11-03 22:24 ` hjl at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: hjl at gcc dot gnu.org @ 2013-10-12 14:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58690

--- Comment #2 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Sat Oct 12 14:55:28 2013
New Revision: 203486

URL: http://gcc.gnu.org/viewcvs?rev=203486&root=gcc&view=rev
Log:
Truncate x32 DImode TLS address to a SImode register

gcc/

    PR target/58690
    * config/i386/i386.c (ix86_copy_addr_to_reg): New function.
    (ix86_expand_movmem): Replace copy_addr_to_reg with
    ix86_copy_addr_to_reg.
    (ix86_expand_setmem): Likewise.

gcc/testsuite/

    PR target/58690
    * gcc.target/i386/pr58690.c: New test

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr58690.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug target/58690] internal compiler error: in copy_to_mode_reg, at explow.c:641
  2013-10-11 15:24 [Bug target/58690] New: internal compiler error: in copy_to_mode_reg, at explow.c:641 hjl.tools at gmail dot com
  2013-10-11 17:01 ` [Bug target/58690] " hjl.tools at gmail dot com
  2013-10-12 14:55 ` hjl at gcc dot gnu.org
@ 2013-10-14  8:58 ` rguenth at gcc dot gnu.org
  2013-11-03 22:24 ` hjl at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-14  8:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58690

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

* [Bug target/58690] internal compiler error: in copy_to_mode_reg, at explow.c:641
  2013-10-11 15:24 [Bug target/58690] New: internal compiler error: in copy_to_mode_reg, at explow.c:641 hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2013-10-14  8:58 ` rguenth at gcc dot gnu.org
@ 2013-11-03 22:24 ` hjl at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: hjl at gcc dot gnu.org @ 2013-11-03 22:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58690

--- Comment #4 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Sun Nov  3 22:22:22 2013
New Revision: 204338

URL: http://gcc.gnu.org/viewcvs?rev=204338&root=gcc&view=rev
Log:
Truncate x32 DImode TLS address to a SImode register

gcc/

    Backport from mainline
    2013-10-12  H.J. Lu  <hongjiu.lu@intel.com>

    PR target/58690
    * config/i386/i386.c (ix86_copy_addr_to_reg): New function.
    (ix86_expand_movmem): Replace copy_addr_to_reg with
    ix86_copy_addr_to_reg.
    (ix86_expand_setmem): Likewise.

gcc/testsuite/

    Backport from mainline
    2013-10-12  H.J. Lu  <hongjiu.lu@intel.com>

    PR target/58690
    * gcc.target/i386/pr58690.c: New test

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.target/i386/pr58690.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/config/i386/i386.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2013-11-03 22:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11 15:24 [Bug target/58690] New: internal compiler error: in copy_to_mode_reg, at explow.c:641 hjl.tools at gmail dot com
2013-10-11 17:01 ` [Bug target/58690] " hjl.tools at gmail dot com
2013-10-12 14:55 ` hjl at gcc dot gnu.org
2013-10-14  8:58 ` rguenth at gcc dot gnu.org
2013-11-03 22:24 ` hjl at gcc dot gnu.org

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