* [Bug jit/95498] unhandled conversion
2020-06-03 13:14 [Bug jit/95498] New: unhandled conversion bouanto at zoho dot com
@ 2020-06-06 12:42 ` bouanto at zoho dot com
2020-06-06 17:49 ` dmalcolm at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bouanto at zoho dot com @ 2020-06-06 12:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95498
--- Comment #1 from bouanto at zoho dot com ---
I'm trying to create a smaller reproducer by calling
gcc_jit_context_dump_to_file, but I don't know where to stop in gdb in order to
get the source info.
How did you do it in https://gcc.gnu.org/bugzilla//show_bug.cgi?id=95521 ?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug jit/95498] unhandled conversion
2020-06-03 13:14 [Bug jit/95498] New: unhandled conversion bouanto at zoho dot com
2020-06-06 12:42 ` [Bug jit/95498] " bouanto at zoho dot com
@ 2020-06-06 17:49 ` dmalcolm at gcc dot gnu.org
2020-06-06 18:07 ` bouanto at zoho dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-06-06 17:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95498
--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Try putting a breakpoint on add_error (there are a few classes with add_error
methods; a sufficiently smart gdb ought to put the breakpoint on all of them).
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug jit/95498] unhandled conversion
2020-06-03 13:14 [Bug jit/95498] New: unhandled conversion bouanto at zoho dot com
2020-06-06 12:42 ` [Bug jit/95498] " bouanto at zoho dot com
2020-06-06 17:49 ` dmalcolm at gcc dot gnu.org
@ 2020-06-06 18:07 ` bouanto at zoho dot com
2020-07-03 0:58 ` bouanto at zoho dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bouanto at zoho dot com @ 2020-06-06 18:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95498
--- Comment #3 from bouanto at zoho dot com ---
(In reply to David Malcolm from comment #2)
> Try putting a breakpoint on add_error (there are a few classes with
> add_error methods; a sufficiently smart gdb ought to put the breakpoint on
> all of them).
I added the call to gcc_jit_context_dump_to_file (ctxt, "/tmp/something.c", 1
/* update_locations */); right after create_code(ctxt) but the parameter loc is
NULL when I reach add_error in gdb so that I cannot print the line number.
It was also null when I tried with the reproducer of this issue:
https://gcc.gnu.org/bugzilla//show_bug.cgi?id=95521
Is there anything else to change in the reproducer so that it updates the
locations accordingly?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug jit/95498] unhandled conversion
2020-06-03 13:14 [Bug jit/95498] New: unhandled conversion bouanto at zoho dot com
` (2 preceding siblings ...)
2020-06-06 18:07 ` bouanto at zoho dot com
@ 2020-07-03 0:58 ` bouanto at zoho dot com
2020-07-13 9:42 ` acoplan at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bouanto at zoho dot com @ 2020-07-03 0:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95498
--- Comment #4 from Antoni <bouanto at zoho dot com> ---
Created attachment 48829
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48829&action=edit
Smaller reproducer for the bug
I was able to reduce the size of the reproducer. I attached it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug jit/95498] unhandled conversion
2020-06-03 13:14 [Bug jit/95498] New: unhandled conversion bouanto at zoho dot com
` (3 preceding siblings ...)
2020-07-03 0:58 ` bouanto at zoho dot com
@ 2020-07-13 9:42 ` acoplan at gcc dot gnu.org
2020-07-13 10:39 ` bouanto at zoho dot com
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: acoplan at gcc dot gnu.org @ 2020-07-13 9:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95498
--- Comment #5 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Created attachment 48867
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48867&action=edit
Minimal reproducer
I've done some exhaustive testing of which combinations of casts are allowed.
It seems that any program of the following form is rejected with "unhandled
conversion":
T f(T x)
{
return (T)(U)x;
}
where T and U are integral types with U being strictly wider than T.
I've attached a minimal handwritten testcase that reproduces the issue. You
should be able to substitute the values passed to t_outer and t_inner for other
types and still reproduce the issue, provided that t_outer is a strictly
narrower type than t_inner.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug jit/95498] unhandled conversion
2020-06-03 13:14 [Bug jit/95498] New: unhandled conversion bouanto at zoho dot com
` (4 preceding siblings ...)
2020-07-13 9:42 ` acoplan at gcc dot gnu.org
@ 2020-07-13 10:39 ` bouanto at zoho dot com
2021-07-18 14:10 ` cvs-commit at gcc dot gnu.org
2021-07-18 14:11 ` bouanto at zoho dot com
7 siblings, 0 replies; 9+ messages in thread
From: bouanto at zoho dot com @ 2020-07-13 10:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95498
--- Comment #6 from Antoni <bouanto at zoho dot com> ---
(In reply to Alex Coplan from comment #5)
> Created attachment 48867 [details]
> Minimal reproducer
>
> I've done some exhaustive testing of which combinations of casts are
> allowed. It seems that any program of the following form is rejected with
> "unhandled conversion":
>
> T f(T x)
> {
> return (T)(U)x;
> }
>
> where T and U are integral types with U being strictly wider than T.
>
> I've attached a minimal handwritten testcase that reproduces the issue. You
> should be able to substitute the values passed to t_outer and t_inner for
> other types and still reproduce the issue, provided that t_outer is a
> strictly narrower type than t_inner.
Yeah, that's what I figured out.
I sent a patch:
https://gcc.gnu.org/pipermail/jit/2020q3/001228.html
I'd like to have a review of it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug jit/95498] unhandled conversion
2020-06-03 13:14 [Bug jit/95498] New: unhandled conversion bouanto at zoho dot com
` (5 preceding siblings ...)
2020-07-13 10:39 ` bouanto at zoho dot com
@ 2021-07-18 14:10 ` cvs-commit at gcc dot gnu.org
2021-07-18 14:11 ` bouanto at zoho dot com
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-18 14:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95498
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Antoni Boucher <antoyo@gcc.gnu.org>:
https://gcc.gnu.org/g:5cca4131e4aabf70a18e362620ad65a3cebf227a
commit r12-2384-g5cca4131e4aabf70a18e362620ad65a3cebf227a
Author: Antoni Boucher <bouanto@zoho.com>
Date: Sun Jul 5 19:07:30 2020 -0400
libgccjit: Handle truncation and extension for casts [PR95498]
2021-07-18 Antoni Boucher <bouanto@zoho.com>
gcc/jit/
PR target/95498
* jit-playback.c (convert): Add support to handle truncation and
extension in the convert function.
gcc/testsuite/
PR target/95498
* jit.dg/all-non-failing-tests.h: New test.
* jit.dg/test-cast.c: New test.
Signed-off-by: Antoni Boucher <bouanto@zoho.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug jit/95498] unhandled conversion
2020-06-03 13:14 [Bug jit/95498] New: unhandled conversion bouanto at zoho dot com
` (6 preceding siblings ...)
2021-07-18 14:10 ` cvs-commit at gcc dot gnu.org
@ 2021-07-18 14:11 ` bouanto at zoho dot com
7 siblings, 0 replies; 9+ messages in thread
From: bouanto at zoho dot com @ 2021-07-18 14:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95498
Antoni <bouanto at zoho dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #8 from Antoni <bouanto at zoho dot com> ---
Fixed in master.
^ permalink raw reply [flat|nested] 9+ messages in thread